Commit 8ed80a54 authored by michael's avatar michael

fix timestamp prediction for low_delay mpeg streams


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@3751 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent b1c1019b
...@@ -325,6 +325,7 @@ static void mpegvideo_extract_headers(AVCodecParserContext *s, ...@@ -325,6 +325,7 @@ static void mpegvideo_extract_headers(AVCodecParserContext *s,
frame_rate_ext_n = (buf[5] >> 5) & 3; frame_rate_ext_n = (buf[5] >> 5) & 3;
frame_rate_ext_d = (buf[5] & 0x1f); frame_rate_ext_d = (buf[5] & 0x1f);
pc->progressive_sequence = buf[1] & (1 << 3); pc->progressive_sequence = buf[1] & (1 << 3);
avctx->has_b_frames= buf[5] >> 7;
pc->width |=(horiz_size_ext << 12); pc->width |=(horiz_size_ext << 12);
pc->height |=( vert_size_ext << 12); pc->height |=( vert_size_ext << 12);
......
...@@ -702,10 +702,8 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st, ...@@ -702,10 +702,8 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st,
if (st->codec.codec_type == CODEC_TYPE_VIDEO) { if (st->codec.codec_type == CODEC_TYPE_VIDEO) {
/* XXX: need has_b_frame, but cannot get it if the codec is /* XXX: need has_b_frame, but cannot get it if the codec is
not initialized */ not initialized */
if ((st->codec.codec_id == CODEC_ID_MPEG1VIDEO || if (( st->codec.codec_id == CODEC_ID_H264
st->codec.codec_id == CODEC_ID_MPEG2VIDEO || || st->codec.has_b_frames) &&
st->codec.codec_id == CODEC_ID_MPEG4 ||
st->codec.codec_id == CODEC_ID_H264) &&
pc && pc->pict_type != FF_B_TYPE) pc && pc->pict_type != FF_B_TYPE)
presentation_delayed = 1; presentation_delayed = 1;
/* this may be redundant, but it shouldnt hurt */ /* this may be redundant, but it shouldnt hurt */
......
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