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

Unified Diff: media/blink/webmediaplayer_impl.cc

Issue 740663002: Relanding 'Ignore seek operations to the current time in pause state' patch (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed review comments Created 6 years 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
« media/base/pipeline_unittest.cc ('K') | « media/base/pipeline_unittest.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 b1744bd1c3d4893f8ed38aa8933ab804430bea90..e0873422a839df297ee6f83c9b676d08e211381e 100644
--- a/media/blink/webmediaplayer_impl.cc
+++ b/media/blink/webmediaplayer_impl.cc
@@ -337,8 +337,20 @@ void WebMediaPlayerImpl::seek(double seconds) {
media_log_->AddEvent(media_log_->CreateSeekEvent(seconds));
// Update our paused time.
- if (paused_)
- paused_time_ = seek_time;
+ // In paused state ignore the seek operations to current time and generate
+ // buffer state change event to eventually fire seeking and seeked events
+ if (paused_) {
+ if (paused_time_ != seek_time) {
+ paused_time_ = seek_time;
+ } else {
+ main_task_runner_->PostTask(
+ FROM_HERE,
+ base::Bind(&WebMediaPlayerImpl::OnPipelineBufferingStateChanged,
+ AsWeakPtr(),
+ BUFFERING_HAVE_ENOUGH));
+ return;
+ }
+ }
seeking_ = true;
« media/base/pipeline_unittest.cc ('K') | « media/base/pipeline_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698