summaryrefslogtreecommitdiffstats
path: root/libavcodec/mpegvideo_parser.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/mpegvideo_parser.c')
-rw-r--r--libavcodec/mpegvideo_parser.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/libavcodec/mpegvideo_parser.c b/libavcodec/mpegvideo_parser.c
index 44bf26d..668a946 100644
--- a/libavcodec/mpegvideo_parser.c
+++ b/libavcodec/mpegvideo_parser.c
@@ -70,8 +70,7 @@ static void mpegvideo_extract_headers(AVCodecParserContext *s,
did_set_size=1;
}
frame_rate_index = buf[3] & 0xf;
- pc->frame_rate.den = avctx->time_base.den = ff_mpeg12_frame_rate_tab[frame_rate_index].num;
- pc->frame_rate.num = avctx->time_base.num = ff_mpeg12_frame_rate_tab[frame_rate_index].den;
+ pc->frame_rate = avctx->framerate = ff_mpeg12_frame_rate_tab[frame_rate_index];
bit_rate = (buf[4]<<10) | (buf[5]<<2) | (buf[6]>>6);
avctx->codec_id = AV_CODEC_ID_MPEG1VIDEO;
}
@@ -95,8 +94,8 @@ static void mpegvideo_extract_headers(AVCodecParserContext *s,
bit_rate = (bit_rate&0x3FFFF) | (bit_rate_ext << 18);
if(did_set_size)
ff_set_dimensions(avctx, pc->width, pc->height);
- avctx->time_base.den = pc->frame_rate.den * (frame_rate_ext_n + 1) * 2;
- avctx->time_base.num = pc->frame_rate.num * (frame_rate_ext_d + 1);
+ avctx->framerate.num = pc->frame_rate.num * (frame_rate_ext_n + 1) * 2;
+ avctx->framerate.den = pc->frame_rate.den * (frame_rate_ext_d + 1);
avctx->codec_id = AV_CODEC_ID_MPEG2VIDEO;
}
break;
@@ -150,6 +149,10 @@ static void mpegvideo_extract_headers(AVCodecParserContext *s,
((avctx->codec_id == AV_CODEC_ID_MPEG1VIDEO && bit_rate != 0x3FFFF) || vbv_delay != 0xFFFF)) {
avctx->bit_rate = 400*bit_rate;
}
+#if FF_API_AVCTX_TIMEBASE
+ if (avctx->framerate.num)
+ avctx->time_base = av_inv_q(avctx->framerate);
+#endif
}
static int mpegvideo_parse(AVCodecParserContext *s,
OpenPOWER on IntegriCloud