Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1541)

Unified Diff: content/renderer/media/android/webmediaplayer_android.cc

Issue 572803002: Fix an issue that video is not seekable (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add comments Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/android/webmediaplayer_android.cc
diff --git a/content/renderer/media/android/webmediaplayer_android.cc b/content/renderer/media/android/webmediaplayer_android.cc
index 35e898e9bac8dba0ea903ec4571ad4eec8ade2cc..4bb016233a36016c2ab746b12df489db162da957 100644
--- a/content/renderer/media/android/webmediaplayer_android.cc
+++ b/content/renderer/media/android/webmediaplayer_android.cc
@@ -735,6 +735,10 @@ void WebMediaPlayerAndroid::OnMediaMetadataChanged(
}
}
+ // UpdateReadyState(WebMediaPlayer::ReadyStateHaveMetadata) will trigger a
+ // call to duration(), which checks |has_valid_metadata_|. so
+ // |has_valid_metadata_| has to be updated before calling UpdateReadyState().
+ has_valid_metadata_ = success;
if (ready_state_ != WebMediaPlayer::ReadyStateHaveEnoughData) {
UpdateReadyState(WebMediaPlayer::ReadyStateHaveMetadata);
UpdateReadyState(WebMediaPlayer::ReadyStateHaveEnoughData);
@@ -745,8 +749,6 @@ void WebMediaPlayerAndroid::OnMediaMetadataChanged(
if (success)
OnVideoSizeChanged(width, height);
- has_valid_metadata_ = success;
-
if (need_to_signal_duration_changed)
client_->durationChanged();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698