aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/ituh263dec.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2014-04-04 12:47:44 +0200
committerAnton Khirnov <anton@khirnov.net>2014-10-15 06:37:43 +0000
commit7ea1b3472a61de4aa4d41b571e99418e4997ad41 (patch)
treefcf38bb7d5d1f770f1e4b8fea256fa6c45313add /libavcodec/ituh263dec.c
parentd565fef1b83b6c5f8afb32229260b79f67c68109 (diff)
downloadffmpeg-7ea1b3472a61de4aa4d41b571e99418e4997ad41.tar.gz
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.
Diffstat (limited to 'libavcodec/ituh263dec.c')
-rw-r--r--libavcodec/ituh263dec.c20
1 files changed, 10 insertions, 10 deletions
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 };
}
}