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

Unified Diff: webkit/glue/webmediaplayer_impl.cc

Issue 5878007: Fix black video frames when seeking (which also fixes flashing poster issue). (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Cache the last available video frame in VideoRendererBase instead of copying a bitmap. Created 10 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/filters/video_renderer_base.cc ('K') | « 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 e13d942cc84d42059d69a5743bdf980ea338e197..4a64b0f71b693404e74fc461ca840a4725767f47 100644
--- a/webkit/glue/webmediaplayer_impl.cc
+++ b/webkit/glue/webmediaplayer_impl.cc
@@ -233,6 +233,7 @@ WebMediaPlayerImpl::WebMediaPlayerImpl(
pipeline_(NULL),
pipeline_thread_("PipelineThread"),
paused_(true),
+ seeking_(false),
playback_rate_(0.0f),
client_(client),
proxy_(NULL),
@@ -368,11 +369,6 @@ void WebMediaPlayerImpl::seek(float seconds) {
return;
}
- // Drop our ready state if the media file isn't fully loaded.
- if (!pipeline_->IsLoaded()) {
- SetReadyState(WebKit::WebMediaPlayer::HaveMetadata);
- }
-
// Try to preserve as much accuracy as possible.
float microseconds = seconds * base::Time::kMicrosecondsPerSecond;
base::TimeDelta seek_time =
@@ -383,6 +379,8 @@ void WebMediaPlayerImpl::seek(float seconds) {
paused_time_ = seek_time;
}
+ seeking_ = true;
+
// Kick off the asynchronous seek!
pipeline_->Seek(
seek_time,
@@ -476,7 +474,7 @@ bool WebMediaPlayerImpl::seeking() const {
if (ready_state_ == WebKit::WebMediaPlayer::HaveNothing)
return false;
- return ready_state_ == WebKit::WebMediaPlayer::HaveMetadata;
+ return seeking_;
}
float WebMediaPlayerImpl::duration() const {
@@ -705,6 +703,7 @@ void WebMediaPlayerImpl::OnPipelineSeek() {
}
SetReadyState(WebKit::WebMediaPlayer::HaveEnoughData);
+ seeking_ = false;
GetClient()->timeChanged();
}
}
« media/filters/video_renderer_base.cc ('K') | « webkit/glue/webmediaplayer_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698