[*KONA] DF240925-02759 [PreCert][SCL][TV][25_Pontus_M][Italy][TivuSat][HbbTV(App... 52/319052/8
authorMaciej Pietka <m.pietka@samsung.com>
Thu, 26 Sep 2024 10:46:10 +0000 (12:46 +0200)
committerBot Blink <blinkbot@samsung.com>
Mon, 14 Oct 2024 12:49:43 +0000 (12:49 +0000)
Do not ignore seek to zero pts when player is still initializing, instead set delayed state to seeking. MMPlayer will start playback
from "live" pts instead of zero for some dash profiles.

Bug: https://jira-eu.sec.samsung.net/browse/VDWASM-1803
Signed-off-by: Maciej Pietka <m.pietka@samsung.com>
Change-Id: Iab63dbe0905e125be106bfe55dd584c75bdff7ef

tizen_src/chromium_impl/media/filters/media_player_bridge_capi_tv.cc

index a8ed73bfe8ea18c978986ab7760bf9b7533bd5e8..1e1374bb83f7ae50d97d6911b675757120e34d87 100644 (file)
@@ -723,19 +723,20 @@ void MediaPlayerBridgeCapiTV::Seek(base::TimeDelta time,
   }
 
   // If seek_cb isn't set, then this call is due to the StartPlayingFrom() call
-  // in the renderer.  In which case, ignore a seek to 0.0.
-  if (!seek_cb) {
-    // Ignore seek to 0 during initialization.
-    if (GetPlayerState() < PLAYER_STATE_READY && time.InSecondsF() == 00) {
-      LOG_ID(INFO, player_id_)
-          << __func__ << " Ignore seek to invalid time during initialization.";
-      return;
-    }
-  }
+  // in the renderer.
   seek_cb_ = std::move(seek_cb);
-  bool is_suspend_seek = IsPlayerSuspended() && playback_time_ != time;
-  if (is_seeking_ || is_suspend_seek || waiting_for_drm_init_complete_ ||
-      is_preparing_ || is_preloading_) {
+
+  const bool is_initializing = GetPlayerState() < PLAYER_STATE_READY;
+  const bool is_suspend_seek = IsPlayerSuspended() && playback_time_ != time;
+  const bool is_start_playing_from_zero = !seek_cb_ && time.is_zero();
+
+  // in the case when the player is currently unable to seek, stash the seek
+  // it will be executed in |MediaPlayerBridgeCapi::ExecuteDelayedPlayerState|
+  const bool should_stash_seek =
+      is_seeking_ || is_suspend_seek || waiting_for_drm_init_complete_ ||
+      is_preparing_ || is_preloading_ || is_initializing;
+
+  if (should_stash_seek) {
     LOG_ID(INFO, player_id_)
         << "(" << static_cast<void*>(this) << ") "
         << " stashing pending seek - " << time.InSecondsF() << "s";
@@ -748,8 +749,11 @@ void MediaPlayerBridgeCapiTV::Seek(base::TimeDelta time,
       delayed_player_state_ = PLAYER_STATE_DELAYED_SEEK;
     }
     pending_seek_duration_ = playback_time_;
-    OnTimeUpdate(player_id_, playback_time_);
-    OnTimeChanged(player_id_);
+
+    if (!is_start_playing_from_zero) {
+      OnTimeUpdate(player_id_, playback_time_);
+      OnTimeChanged(player_id_);
+    }
 
     if (is_suspend_seek) {
       Resume();