summaryrefslogtreecommitdiffstats
path: root/media/webm/webm_stream_parser.cc
diff options
context:
space:
mode:
authoracolwell@chromium.org <acolwell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-06 19:16:53 +0000
committeracolwell@chromium.org <acolwell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-06 19:16:53 +0000
commit07b405307121188af8edc4c65c46c134f419a662 (patch)
tree3fd0febf03149bd1519791b9989334c754990ba6 /media/webm/webm_stream_parser.cc
parentcea8417218ddd2f3012aaf221dd46dc80c7c2c2f (diff)
downloadchromium_src-07b405307121188af8edc4c65c46c134f419a662.zip
chromium_src-07b405307121188af8edc4c65c46c134f419a662.tar.gz
chromium_src-07b405307121188af8edc4c65c46c134f419a662.tar.bz2
WebM parser bug fixes for live streams.
- Update ChunkDemuxer so kInfiniteDuration streams are not seekable. - Add support for Segment & Cluster elements of unknown size to WebMListParser. - Update WebMStreamParser to treat content without a Duration header as having kInfiniteDuration. BUG=116824 TEST=ChunkDemuxerTest.TestWebMFile_LiveAudioAndVideo, WebMParserTest.ReservedIds, WebMParserTest.ReservedSizes Review URL: http://codereview.chromium.org/9600028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@125197 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/webm/webm_stream_parser.cc')
-rw-r--r--media/webm/webm_stream_parser.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/media/webm/webm_stream_parser.cc b/media/webm/webm_stream_parser.cc
index d49ed7c..036f7e7b0 100644
--- a/media/webm/webm_stream_parser.cc
+++ b/media/webm/webm_stream_parser.cc
@@ -281,9 +281,13 @@ int WebMStreamParser::ParseInfoAndTracks(const uint8* data, int size) {
bytes_parsed += result;
- double mult = info_parser.timecode_scale() / 1000.0;
- base::TimeDelta duration =
- base::TimeDelta::FromMicroseconds(info_parser.duration() * mult);
+ base::TimeDelta duration = kInfiniteDuration();
+
+ if (info_parser.duration() > 0) {
+ double mult = info_parser.timecode_scale() / 1000.0;
+ int64 duration_in_us = info_parser.duration() * mult;
+ duration = base::TimeDelta::FromMicroseconds(duration_in_us);
+ }
FFmpegConfigHelper config_helper;