| Index: media/base/android/media_player_bridge.cc
|
| diff --git a/media/base/android/media_player_bridge.cc b/media/base/android/media_player_bridge.cc
|
| index 1022e4ef2b92aef264c3395374614402629f47cc..84a2e108917d78ae50fabb84ca63719ef9b0bc1d 100644
|
| --- a/media/base/android/media_player_bridge.cc
|
| +++ b/media/base/android/media_player_bridge.cc
|
| @@ -37,6 +37,7 @@ MediaPlayerBridge::MediaPlayerBridge(
|
| frame_url),
|
| prepared_(false),
|
| pending_play_(false),
|
| + should_seek_on_prepare_(false),
|
| url_(url),
|
| first_party_for_cookies_(first_party_for_cookies),
|
| user_agent_(user_agent),
|
| @@ -337,6 +338,7 @@ int MediaPlayerBridge::GetVideoHeight() {
|
| void MediaPlayerBridge::SeekTo(base::TimeDelta timestamp) {
|
| // Record the time to seek when OnMediaPrepared() is called.
|
| pending_seek_ = timestamp;
|
| + should_seek_on_prepare_ = true;
|
|
|
| if (j_media_player_bridge_.is_null())
|
| Prepare();
|
| @@ -367,8 +369,11 @@ void MediaPlayerBridge::Release() {
|
| return;
|
|
|
| time_update_timer_.Stop();
|
| - if (prepared_)
|
| + if (prepared_) {
|
| pending_seek_ = GetCurrentTime();
|
| + should_seek_on_prepare_ = true;
|
| + }
|
| +
|
| prepared_ = false;
|
| pending_play_ = false;
|
| SetVideoSurface(gfx::ScopedJavaSurface());
|
| @@ -415,7 +420,11 @@ void MediaPlayerBridge::OnMediaPrepared() {
|
|
|
| // If media player was recovered from a saved state, consume all the pending
|
| // events.
|
| - PendingSeekInternal(pending_seek_);
|
| + if (should_seek_on_prepare_) {
|
| + PendingSeekInternal(pending_seek_);
|
| + pending_seek_ = base::TimeDelta::FromMilliseconds(0);
|
| + should_seek_on_prepare_ = false;
|
| + }
|
|
|
| if (pending_play_) {
|
| StartInternal();
|
|
|