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

Unified Diff: webkit/glue/webmediaplayer_impl.cc

Issue 332017: Update the paused time when seeking while paused. (Closed)
Patch Set: Created 11 years, 2 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: webkit/glue/webmediaplayer_impl.cc
diff --git a/webkit/glue/webmediaplayer_impl.cc b/webkit/glue/webmediaplayer_impl.cc
index 12bf8b8cb895c666adb043cc00a1e42335f9d302..e1a1c591a4482007f81beaa405e7bc56adcde525 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();
}
« 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