summaryrefslogtreecommitdiff
path: root/libavcodec/libx264.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-01-25 16:19:39 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-01-25 16:31:30 +0100
commit018e2b57ca8318ae2eaa72e22520d53ffb3404c7 (patch)
tree26ccca48b74445434cb3b6b4d8d88ed97c690c17 /libavcodec/libx264.c
parent5f4d04d0847020e62e0cf2d4146e67d42d38e17d (diff)
avcodec/libx264: also consider ticks per frame for fps/timebase setup
Setting fps = 1/timebase is not correct Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/libx264.c')
-rw-r--r--libavcodec/libx264.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index 8da18707eb..60076301a6 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -557,8 +557,10 @@ static av_cold int X264_init(AVCodecContext *avctx)
av_reduce(&sw, &sh, avctx->sample_aspect_ratio.num, avctx->sample_aspect_ratio.den, 4096);
x4->params.vui.i_sar_width = sw;
x4->params.vui.i_sar_height = sh;
- x4->params.i_fps_num = x4->params.i_timebase_den = avctx->time_base.den;
- x4->params.i_fps_den = x4->params.i_timebase_num = avctx->time_base.num;
+ x4->params.i_timebase_den = avctx->time_base.den;
+ x4->params.i_timebase_num = avctx->time_base.num;
+ x4->params.i_fps_num = avctx->time_base.den;
+ x4->params.i_fps_den = avctx->time_base.num * avctx->ticks_per_frame;
x4->params.analyse.b_psnr = avctx->flags & CODEC_FLAG_PSNR;