diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-10-15 15:50:49 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-10-15 15:52:35 +0200 |
commit | 801876fb079ecac157dbbffe2b6d10f2e2408fbf (patch) | |
tree | 752d52c3f872831811aa0fa9aa64b3e648572e70 /libavcodec/utils.c | |
parent | 17085a0251a1493f6447aa3d2ee06fda2c9402f0 (diff) | |
download | ffmpeg-801876fb079ecac157dbbffe2b6d10f2e2408fbf.tar.gz |
avcodec/utils: fix time_base after the framerate addition
time_base != 1/framerate for example for interlaced video
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r-- | libavcodec/utils.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 12d0196947..9f65340d93 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -1677,7 +1677,7 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code #if FF_API_AVCTX_TIMEBASE if (avctx->framerate.num > 0 && avctx->framerate.den > 0) - avctx->time_base = av_inv_q(avctx->framerate); + avctx->time_base = av_inv_q(av_mul_q(avctx->framerate, (AVRational){avctx->ticks_per_frame, 1})); #endif } end: @@ -2391,7 +2391,7 @@ fail: #if FF_API_AVCTX_TIMEBASE if (avctx->framerate.num > 0 && avctx->framerate.den > 0) - avctx->time_base = av_inv_q(avctx->framerate); + avctx->time_base = av_inv_q(av_mul_q(avctx->framerate, (AVRational){avctx->ticks_per_frame, 1})); #endif return ret; |