From 7ea1b3472a61de4aa4d41b571e99418e4997ad41 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Fri, 4 Apr 2014 12:47:44 +0200 Subject: lavc: deprecate the use of AVCodecContext.time_base for decoding When decoding, this field holds the inverse of the framerate that can be written in the headers for some codecs. Using a field called 'time_base' for this is very misleading, as there are no timestamps associated with it. Furthermore, this field is used for a very different purpose during encoding. Add a new field, called 'framerate', to replace the use of time_base for decoding. --- libavcodec/mpeg12dec.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'libavcodec/mpeg12dec.c') diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c index 93e3900ce3..38daeaa954 100644 --- a/libavcodec/mpeg12dec.c +++ b/libavcodec/mpeg12dec.c @@ -1257,15 +1257,14 @@ static int mpeg_decode_postinit(AVCodecContext *avctx) if (avctx->codec_id == AV_CODEC_ID_MPEG1VIDEO) { // MPEG-1 fps - avctx->time_base.den = ff_mpeg12_frame_rate_tab[s->frame_rate_index].num; - avctx->time_base.num = ff_mpeg12_frame_rate_tab[s->frame_rate_index].den; + avctx->framerate = ff_mpeg12_frame_rate_tab[s->frame_rate_index]; // MPEG-1 aspect avctx->sample_aspect_ratio = av_d2q(1.0 / ff_mpeg1_aspect[s->aspect_ratio_info], 255); avctx->ticks_per_frame = 1; } else { // MPEG-2 // MPEG-2 fps - av_reduce(&s->avctx->time_base.den, - &s->avctx->time_base.num, + av_reduce(&s->avctx->framerate.num, + &s->avctx->framerate.den, ff_mpeg12_frame_rate_tab[s->frame_rate_index].num * s1->frame_rate_ext.num * 2, ff_mpeg12_frame_rate_tab[s->frame_rate_index].den * s1->frame_rate_ext.den, 1 << 30); -- cgit v1.2.3