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

Unified Diff: media/blink/webmediaplayer_impl.cc

Issue 1305273007: Don't short-circuit MSE seeks in WebMediaPlayer impls (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix a further build issue for Android Created 5 years, 4 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 | « content/renderer/media/android/webmediaplayer_android.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/blink/webmediaplayer_impl.cc
diff --git a/media/blink/webmediaplayer_impl.cc b/media/blink/webmediaplayer_impl.cc
index fb50bc3f5a4e850e9ac4bf8dcd5f19bc5e43cb94..473df2ad107380b5f88147a14883ec40c5c3eaf5 100644
--- a/media/blink/webmediaplayer_impl.cc
+++ b/media/blink/webmediaplayer_impl.cc
@@ -303,13 +303,13 @@ void WebMediaPlayerImpl::seek(double seconds) {
if (seeking_) {
if (new_seek_time == seek_time_) {
if (chunk_demuxer_) {
- if (!pending_seek_) {
- // If using media source demuxer, only suppress redundant seeks if
- // there is no pending seek. This enforces that any pending seek that
- // results in a demuxer seek is preceded by matching
- // CancelPendingSeek() and StartWaitingForSeek() calls.
- return;
- }
+ // Don't suppress any redundant in-progress MSE seek. There could have
+ // been changes to the underlying buffers after seeking the demuxer and
+ // before receiving OnPipelineSeeked() for the currently in-progress
+ // seek.
+ MEDIA_LOG(DEBUG, media_log_)
+ << "Detected MediaSource seek to same time as in-progress seek to "
+ << seek_time_ << ".";
} else {
// Suppress all redundant seeks if unrestricted by media source demuxer
// API.
@@ -329,11 +329,16 @@ void WebMediaPlayerImpl::seek(double seconds) {
media_log_->AddEvent(media_log_->CreateSeekEvent(seconds));
// Update our paused time.
- // In paused state ignore the seek operations to current time if the loading
- // is completed and generate OnPipelineBufferingStateChanged event to
- // eventually fire seeking and seeked events
+ // For non-MSE playbacks, in paused state ignore the seek operations to
+ // current time if the loading is completed and generate
+ // OnPipelineBufferingStateChanged event to eventually fire seeking and seeked
+ // events. We don't short-circuit MSE seeks in this logic because the
+ // underlying buffers around the seek time might have changed (or even been
+ // removed) since previous seek/preroll/pause action, and the pipeline might
+ // need to flush so the new buffers are decoded and rendered instead of the
+ // old ones.
if (paused_) {
- if (paused_time_ != new_seek_time) {
+ if (paused_time_ != new_seek_time || chunk_demuxer_) {
paused_time_ = new_seek_time;
} else if (old_state == ReadyStateHaveEnoughData) {
main_task_runner_->PostTask(
« no previous file with comments | « content/renderer/media/android/webmediaplayer_android.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698