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

Unified Diff: webkit/glue/webmediaplayer_impl.cc

Issue 7890012: Fixing dropped seeks. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Code review fixes. Created 9 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 | « webkit/glue/webmediaplayer_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/webmediaplayer_impl.cc
diff --git a/webkit/glue/webmediaplayer_impl.cc b/webkit/glue/webmediaplayer_impl.cc
index b30e013ba45e4076b05352f11bece97748310659..b6f41d9ab095b4567c3af0b9e3f8b9a3ff3436e8 100644
--- a/webkit/glue/webmediaplayer_impl.cc
+++ b/webkit/glue/webmediaplayer_impl.cc
@@ -99,6 +99,7 @@ WebMediaPlayerImpl::WebMediaPlayerImpl(
paused_(true),
seeking_(false),
playback_rate_(0.0f),
+ pending_seek_(false),
client_(client),
proxy_(NULL),
media_stream_client_(media_stream_client),
@@ -295,6 +296,12 @@ void WebMediaPlayerImpl::seek(float seconds) {
return;
}
+ if (seeking_) {
+ pending_seek_ = true;
+ pending_seek_seconds_ = seconds;
+ return;
+ }
+
media_log_->AddEvent(media_log_->CreateSeekEvent(seconds));
base::TimeDelta seek_time = ConvertSecondsToTimestamp(seconds);
@@ -694,6 +701,13 @@ void WebMediaPlayerImpl::OnPipelineInitialize(PipelineStatus status) {
void WebMediaPlayerImpl::OnPipelineSeek(PipelineStatus status) {
DCHECK(MessageLoop::current() == main_loop_);
+ seeking_ = false;
+ if (pending_seek_) {
+ pending_seek_ = false;
+ seek(pending_seek_seconds_);
+ return;
+ }
+
if (status == media::PIPELINE_OK) {
// Update our paused time.
if (paused_) {
@@ -701,7 +715,6 @@ void WebMediaPlayerImpl::OnPipelineSeek(PipelineStatus status) {
}
SetReadyState(WebKit::WebMediaPlayer::HaveEnoughData);
- seeking_ = false;
GetClient()->timeChanged();
}
}
« no previous file with comments | « webkit/glue/webmediaplayer_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698