Commit fb66cafb authored by scherkus@chromium.org's avatar scherkus@chromium.org

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
parent bace3746
......@@ -123,10 +123,7 @@ IN_PROC_BROWSER_TEST_P(MediaTest, VideoBearAviMp3Mpeg4) {
PlayVideo("bear_mpeg4_mp3.avi", GetParam());
}
// TODO(scherkus): MPEG-4 ASP contains B-frames and out-of-order decoding, which
// makes FFmpeg spit out video frames with no timestamp. As a result we DCHECK()
// all over the place http://crbug.com/169570
IN_PROC_BROWSER_TEST_P(MediaTest, DISABLED_VideoBearAviMp3Mpeg4Asp) {
IN_PROC_BROWSER_TEST_P(MediaTest, VideoBearAviMp3Mpeg4Asp) {
PlayVideo("bear_mpeg4asp_mp3.avi", GetParam());
}
......
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment