[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
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|