diff options
author | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-13 21:40:38 +0000 |
---|---|---|
committer | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-13 21:40:38 +0000 |
commit | fb66cafbeadd31e8c34578e90d62c0b6ab4b8c42 (patch) | |
tree | 43648b6d359f4fb07d18a5e5e11956f3168d7f7e /media | |
parent | bace3746bdb912302f0b15443ee264134ff3b7ad (diff) | |
download | chromium_src-fb66cafbeadd31e8c34578e90d62c0b6ab4b8c42.zip chromium_src-fb66cafbeadd31e8c34578e90d62c0b6ab4b8c42.tar.gz chromium_src-fb66cafbeadd31e8c34578e90d62c0b6ab4b8c42.tar.bz2 |
Set AVFMT_FLAG_GENPTS when demuxing AVI content.
Storing MPEG-4 B-frames in AVI has always been a bit of a hack and by default av_read_frame() will return non-timestamped video packets for such content. AVFMT_FLAG_GENPTS takes advantage of AVI's constant framerate to generate presentation timestamps at the expense of parsing delay.
BUG=169570
Review URL: https://codereview.chromium.org/12209111
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@182310 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media')
-rw-r--r-- | media/filters/ffmpeg_demuxer.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/media/filters/ffmpeg_demuxer.cc b/media/filters/ffmpeg_demuxer.cc index 56929bc..f1b0385 100644 --- a/media/filters/ffmpeg_demuxer.cc +++ b/media/filters/ffmpeg_demuxer.cc @@ -478,6 +478,11 @@ void FFmpegDemuxer::OnFindStreamInfoDone(const PipelineStatusCB& status_cb, if (start_time_ == kNoTimestamp()) start_time_ = base::TimeDelta(); + // MPEG-4 B-frames cause grief for a simple container like AVI. Enable PTS + // generation so we always get timestamps, see http://crbug.com/169570 + if (strcmp(format_context->iformat->name, "avi") == 0) + format_context->flags |= AVFMT_FLAG_GENPTS; + // Good to go: set the duration and bitrate and notify we're done // initializing. host_->SetDuration(max_duration); |