[HBBTV] Start playback from the uri anchor. 16/320416/4
authorKajetan Brzuszczak <k.brzuszczak@partner.samsung.com>
Wed, 13 Nov 2024 13:17:11 +0000 (14:17 +0100)
committerBot Blink <blinkbot@samsung.com>
Fri, 15 Nov 2024 08:16:49 +0000 (08:16 +0000)
[Problem]
After using `t=X` anchor, playback starts from 0 when
 it should start from pts:X

[Cause]
Loading media element triggers default seek to pts:0,
  which overrides an already prepared content by mmplayer
  with a valid timestamp.

[Solution]
Skip the initial seek.

Bug: https://jira-eu.sec.samsung.net/browse/VDWASM-1905
Signed-off-by: Kajetan Brzuszczak <k.brzuszczak@partner.samsung.com>
Change-Id: I8055e42eb8c955eac8fbe7fbf270966ce0262e27

tizen_src/chromium_impl/media/filters/media_player_bridge_capi_tv.cc

index 18568050592fcbad20168f69c2c10457b1cbadf0..71d64d1e47b28d4afc5aa1786eaa872eef679b9d 100644 (file)
@@ -754,13 +754,16 @@ void MediaPlayerBridgeCapiTV::Seek(base::TimeDelta time,
     return;
   }
 
-  // If seek_cb isn't set, then this call is due to the StartPlayingFrom() call
-  // in the renderer.
-  seek_cb_ = std::move(seek_cb);
-
   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();
+  const bool is_start_playing_from_zero = !seek_cb && time.is_zero();
+
+  if (is_initializing && is_start_playing_from_zero) {
+    LOG_ID(INFO, player_id_) << "Ignore initial seek";
+    return;
+  }
+
+  seek_cb_ = std::move(seek_cb);
 
   // in the case when the player is currently unable to seek, stash the seek
   // it will be executed in |MediaPlayerBridgeCapi::ExecuteDelayedPlayerState|