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/ituh263dec.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'libavcodec/ituh263dec.c') diff --git a/libavcodec/ituh263dec.c b/libavcodec/ituh263dec.c index dc3de30bb0..da78e5d35a 100644 --- a/libavcodec/ituh263dec.c +++ b/libavcodec/ituh263dec.c @@ -81,7 +81,7 @@ void ff_h263_show_pict_info(MpegEncContext *s){ s->modified_quant ? " MQ" : "", s->loop_filter ? " LOOP" : "", s->h263_slice_structured ? " SS" : "", - s->avctx->time_base.den, s->avctx->time_base.num + s->avctx->framerate.num, s->avctx->framerate.den ); } } @@ -938,7 +938,7 @@ int ff_h263_decode_picture_header(MpegEncContext *s) s->width = width; s->height = height; s->avctx->sample_aspect_ratio= (AVRational){12,11}; - s->avctx->time_base= (AVRational){1001, 30000}; + s->avctx->framerate = (AVRational){ 30000, 1001 }; } else { int ufep; @@ -1034,18 +1034,18 @@ int ff_h263_decode_picture_header(MpegEncContext *s) if(s->custom_pcf){ int gcd; - s->avctx->time_base.den= 1800000; - s->avctx->time_base.num= 1000 + get_bits1(&s->gb); - s->avctx->time_base.num*= get_bits(&s->gb, 7); - if(s->avctx->time_base.num == 0){ + s->avctx->framerate.num = 1800000; + s->avctx->framerate.den = 1000 + get_bits1(&s->gb); + s->avctx->framerate.den *= get_bits(&s->gb, 7); + if(s->avctx->framerate.den == 0){ av_log(s, AV_LOG_ERROR, "zero framerate\n"); return -1; } - gcd= av_gcd(s->avctx->time_base.den, s->avctx->time_base.num); - s->avctx->time_base.den /= gcd; - s->avctx->time_base.num /= gcd; + gcd= av_gcd(s->avctx->framerate.den, s->avctx->framerate.num); + s->avctx->framerate.den /= gcd; + s->avctx->framerate.num /= gcd; }else{ - s->avctx->time_base= (AVRational){1001, 30000}; + s->avctx->framerate = (AVRational){ 30000, 1001 }; } } -- cgit v1.2.3