From fd286f25135fdf7c7eff85fee35fdd90d11b88fc Mon Sep 17 00:00:00 2001 From: "hclam@chromium.org" Date: Tue, 20 Apr 2010 23:45:15 +0000 Subject: Issues with video looping Some video streams are badly muxed and have video packets with timestamps greater than the duration. This causes the logic in the video renderer to sleep forever and never read the end-of-stream packet and thus the stream is never ended. This change adjusted the condition on when we should sleep and handle timestamp greater than duration as a special case. TEST=video loops BUG=41579 Review URL: http://codereview.chromium.org/1652011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45124 0039d316-1c4b-4281-b951-d872f2087c98 --- webkit/glue/webmediaplayer_impl.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'webkit') diff --git a/webkit/glue/webmediaplayer_impl.cc b/webkit/glue/webmediaplayer_impl.cc index 41c76f7..d3ef789 100644 --- a/webkit/glue/webmediaplayer_impl.cc +++ b/webkit/glue/webmediaplayer_impl.cc @@ -418,7 +418,7 @@ bool WebMediaPlayerImpl::seeking() const { float WebMediaPlayerImpl::duration() const { DCHECK(MessageLoop::current() == main_loop_); - return static_cast(pipeline_->GetDuration().InSecondsF()); + return static_cast(pipeline_->GetMediaDuration().InSecondsF()); } float WebMediaPlayerImpl::currentTime() const { @@ -452,7 +452,7 @@ float WebMediaPlayerImpl::maxTimeSeekable() const { // TODO(hclam): We need to update this when we have better caching. if (pipeline_->IsStreaming()) return 0.0f; - return static_cast(pipeline_->GetDuration().InSecondsF()); + return static_cast(pipeline_->GetMediaDuration().InSecondsF()); } unsigned long long WebMediaPlayerImpl::bytesLoaded() const { @@ -572,7 +572,7 @@ void WebMediaPlayerImpl::OnPipelineInitialize() { WebKit::WebTimeRanges new_buffered(static_cast(1)); new_buffered[0].start = 0.0f; new_buffered[0].end = - static_cast(pipeline_->GetDuration().InSecondsF()); + static_cast(pipeline_->GetMediaDuration().InSecondsF()); buffered_.swap(new_buffered); // Since we have initialized the pipeline, say we have everything otherwise -- cgit v1.1