summaryrefslogtreecommitdiffstats
path: root/webkit/glue
diff options
context:
space:
mode:
authorscherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-22 17:34:13 +0000
committerscherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-22 17:34:13 +0000
commitb3766a2da2bb9cae1e09f941ef6a6235a993b3f9 (patch)
tree5c5ca5c7ac6ba13e77cb3529b51401566cf2a6ef /webkit/glue
parent0f6b60f6d5df15005e5ab9fd18bb3402fcdc56df (diff)
downloadchromium_src-b3766a2da2bb9cae1e09f941ef6a6235a993b3f9.zip
chromium_src-b3766a2da2bb9cae1e09f941ef6a6235a993b3f9.tar.gz
chromium_src-b3766a2da2bb9cae1e09f941ef6a6235a993b3f9.tar.bz2
Fix black video frames when seeking (which also fixes flashing poster issue).
Keep track of the last available video frame in VideoRendererBase. Don't drop our readystate when starting to seek as we do actually have something to display (this fixes the poster issue). Patch by sjl@chromium.org: http://codereview.chromium.org/5878007/ BUG=57173, 50581 TEST=media_unittests, test_shell_tests, media layout tests git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69956 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue')
-rw-r--r--webkit/glue/webmediaplayer_impl.cc11
-rw-r--r--webkit/glue/webmediaplayer_impl.h1
2 files changed, 6 insertions, 6 deletions
diff --git a/webkit/glue/webmediaplayer_impl.cc b/webkit/glue/webmediaplayer_impl.cc
index e13d942..4a64b0f 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();
}
}
diff --git a/webkit/glue/webmediaplayer_impl.h b/webkit/glue/webmediaplayer_impl.h
index 8aa6661..bae0d9b 100644
--- a/webkit/glue/webmediaplayer_impl.h
+++ b/webkit/glue/webmediaplayer_impl.h
@@ -303,6 +303,7 @@ class WebMediaPlayerImpl : public WebKit::WebMediaPlayer,
// clock can creep forward a little bit while the asynchronous
// SetPlaybackRate(0) is being executed.
bool paused_;
+ bool seeking_;
float playback_rate_;
base::TimeDelta paused_time_;