summaryrefslogtreecommitdiffstats
path: root/webkit/glue/webmediaplayer_impl.cc
diff options
context:
space:
mode:
authorhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-04 22:41:11 +0000
committerhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-04 22:41:11 +0000
commit47b06ceb1db1bf7987a28af1879f807279a7a561 (patch)
tree5a93a486d8203d0af0009cbe607dfba5cb7d4464 /webkit/glue/webmediaplayer_impl.cc
parent638694c1f47e6aa78a0ea55660e5f9f42967ceb9 (diff)
downloadchromium_src-47b06ceb1db1bf7987a28af1879f807279a7a561.zip
chromium_src-47b06ceb1db1bf7987a28af1879f807279a7a561.tar.gz
chromium_src-47b06ceb1db1bf7987a28af1879f807279a7a561.tar.bz2
Play WebM live stream
BUG=44891 TEST=Can play live stream http://195.10.10.75:8800/live.webm This patch allows a live WebM stream to be played. After demuxing by FFmpeg, the duration was set to an invalid value. This makes the video pipeline to set duration to 0, and so WebKit never allows us to play because currentTime == duration all the time. This patch sets duration to an infinite value when duration is reported as invalid in FFmpeg. Review URL: http://codereview.chromium.org/3031036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54983 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/webmediaplayer_impl.cc')
-rw-r--r--webkit/glue/webmediaplayer_impl.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/webkit/glue/webmediaplayer_impl.cc b/webkit/glue/webmediaplayer_impl.cc
index f5b87cf..4de52a3 100644
--- a/webkit/glue/webmediaplayer_impl.cc
+++ b/webkit/glue/webmediaplayer_impl.cc
@@ -4,6 +4,8 @@
#include "webkit/glue/webmediaplayer_impl.h"
+#include <limits>
+
#include "base/callback.h"
#include "base/command_line.h"
#include "media/base/limits.h"
@@ -417,7 +419,10 @@ bool WebMediaPlayerImpl::seeking() const {
float WebMediaPlayerImpl::duration() const {
DCHECK(MessageLoop::current() == main_loop_);
- return static_cast<float>(pipeline_->GetMediaDuration().InSecondsF());
+ base::TimeDelta duration = pipeline_->GetMediaDuration();
+ if (duration.InMicroseconds() == media::Limits::kMaxTimeInMicroseconds)
+ return std::numeric_limits<float>::infinity();
+ return static_cast<float>(duration.InSecondsF());
}
float WebMediaPlayerImpl::currentTime() const {