diff options
author | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-24 01:03:03 +0000 |
---|---|---|
committer | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-24 01:03:03 +0000 |
commit | 44ff37c096f96ce2c709516aca9bfd000d5737b0 (patch) | |
tree | 389d33363177aad690744f9cb9ed2d3b552280f5 /webkit/glue/webmediaplayer_impl.cc | |
parent | 159c51138bddf2040572a811dcbaa0d3aab35b6d (diff) | |
download | chromium_src-44ff37c096f96ce2c709516aca9bfd000d5737b0.zip chromium_src-44ff37c096f96ce2c709516aca9bfd000d5737b0.tar.gz chromium_src-44ff37c096f96ce2c709516aca9bfd000d5737b0.tar.bz2 |
Update the paused time when seeking while paused.
Fixes regression caused by r29851.
BUG=13907
TEST=video-seeking.html should start passing reliably
Review URL: http://codereview.chromium.org/332017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29983 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/webmediaplayer_impl.cc')
-rw-r--r-- | webkit/glue/webmediaplayer_impl.cc | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/webkit/glue/webmediaplayer_impl.cc b/webkit/glue/webmediaplayer_impl.cc index 12bf8b8..e1a1c59 100644 --- a/webkit/glue/webmediaplayer_impl.cc +++ b/webkit/glue/webmediaplayer_impl.cc @@ -295,8 +295,17 @@ void WebMediaPlayerImpl::seek(float seconds) { // Try to preserve as much accuracy as possible. float microseconds = seconds * base::Time::kMicrosecondsPerSecond; + base::TimeDelta seek_time = + base::TimeDelta::FromMicroseconds(static_cast<int64>(microseconds)); + + // Update our paused time. + if (paused_) { + paused_time_ = seek_time; + } + + // Kick off the asynchronous seek! pipeline_->Seek( - base::TimeDelta::FromMicroseconds(static_cast<int64>(microseconds)), + seek_time, NewCallback(proxy_.get(), &WebMediaPlayerImpl::Proxy::PipelineSeekCallback)); } @@ -558,6 +567,11 @@ void WebMediaPlayerImpl::OnPipelineInitialize() { void WebMediaPlayerImpl::OnPipelineSeek() { DCHECK(MessageLoop::current() == main_loop_); if (pipeline_->GetError() == media::PIPELINE_OK) { + // Update our paused time. + if (paused_) { + paused_time_ = pipeline_->GetCurrentTime(); + } + SetReadyState(WebKit::WebMediaPlayer::HaveEnoughData); GetClient()->timeChanged(); } |