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

Unified Diff: media/blink/webmediaplayer_impl.cc

Issue 787373008: Pass seek event through pipeline during loading state (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updated comment Created 5 years, 11 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: media/blink/webmediaplayer_impl.cc
diff --git a/media/blink/webmediaplayer_impl.cc b/media/blink/webmediaplayer_impl.cc
index 9f0c53db268226243b0244ab537c6ec8d81fe47f..f217247ff41f7bd4d22cc4fbec447b6d7f3ca0e3 100644
--- a/media/blink/webmediaplayer_impl.cc
+++ b/media/blink/webmediaplayer_impl.cc
@@ -310,6 +310,7 @@ void WebMediaPlayerImpl::seek(double seconds) {
ended_ = false;
+ ReadyState old_state = ready_state_;
if (ready_state_ > WebMediaPlayer::ReadyStateHaveMetadata)
SetReadyState(WebMediaPlayer::ReadyStateHaveMetadata);
@@ -326,16 +327,13 @@ 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 and generate
- // OnPipelineSeeked and OnPipelineBufferingStateChanged events
- // to eventually fire seeking and seeked events
+ // 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
if (paused_) {
if (paused_time_ != seek_time) {
paused_time_ = seek_time;
- } else {
- main_task_runner_->PostTask(
- FROM_HERE, base::Bind(&WebMediaPlayerImpl::OnPipelineSeeked,
- AsWeakPtr(), false, PIPELINE_OK));
+ } else if (old_state == ReadyStateHaveEnoughData) {
main_task_runner_->PostTask(
FROM_HERE,
base::Bind(&WebMediaPlayerImpl::OnPipelineBufferingStateChanged,
« 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