summaryrefslogtreecommitdiffstats
path: root/media
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 /media
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 'media')
-rw-r--r--media/base/limits.h4
-rw-r--r--media/filters/ffmpeg_demuxer.cc7
2 files changed, 10 insertions, 1 deletions
diff --git a/media/base/limits.h b/media/base/limits.h
index 583d6dd..8694efa 100644
--- a/media/base/limits.h
+++ b/media/base/limits.h
@@ -20,9 +20,11 @@ struct Limits {
static const size_t kMaxSampleRate = 192000;
static const size_t kMaxChannels = 32;
static const size_t kMaxBPS = 64;
+
+ // Maximum possible time.
+ static const int64 kMaxTimeInMicroseconds = kint64max;
};
} // namespace media
#endif // MEDIA_BASE_LIMITS_H_
-
diff --git a/media/filters/ffmpeg_demuxer.cc b/media/filters/ffmpeg_demuxer.cc
index daf083e..5c2a913 100644
--- a/media/filters/ffmpeg_demuxer.cc
+++ b/media/filters/ffmpeg_demuxer.cc
@@ -9,6 +9,7 @@
#include "base/string_util.h"
#include "base/time.h"
#include "media/base/filter_host.h"
+#include "media/base/limits.h"
#include "media/base/media_switches.h"
#include "media/ffmpeg/ffmpeg_common.h"
#include "media/ffmpeg/ffmpeg_util.h"
@@ -468,7 +469,13 @@ void FFmpegDemuxer::InitializeTask(DataSource* data_source,
max_duration =
std::max(max_duration,
ConvertTimestamp(av_time_base, format_context_->duration));
+ } else {
+ // If the duration is not a valid value. Assume that this is a live stream
+ // and we set duration to the maximum int64 number to represent infinity.
+ max_duration = base::TimeDelta::FromMicroseconds(
+ Limits::kMaxTimeInMicroseconds);
}
+
// Good to go: set the duration and notify we're done initializing.
host()->SetDuration(max_duration);
callback->Run();