[FFmpeg-devel] [PATCH v2 7/8] libkvazaar: Fix setting framerate

Arttu Ylä-Outinen arttu.yla-outinen at tut.fi
Tue Sep 29 15:29:14 CEST 2015


The divisor and dividend in the equation had been swapped, making the
result the inverse of the actual framerate.

Signed-off-by: Arttu Ylä-Outinen <arttu.yla-outinen at tut.fi>
---
v2: Fix error in the commit message (bitrate --> framerate).
---
 libavcodec/libkvazaar.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/libkvazaar.c b/libavcodec/libkvazaar.c
index 0879844..0cf890f 100644
--- a/libavcodec/libkvazaar.c
+++ b/libavcodec/libkvazaar.c
@@ -73,7 +73,7 @@ static av_cold int libkvazaar_init(AVCodecContext *avctx)
     cfg->width = avctx->width;
     cfg->height = avctx->height;
     cfg->framerate =
-      (double)(avctx->time_base.num * avctx->ticks_per_frame) / avctx->time_base.den;
+      avctx->time_base.den / (double)(avctx->time_base.num * avctx->ticks_per_frame);
     cfg->threads = avctx->thread_count;
     cfg->target_bitrate = avctx->bit_rate;
     cfg->vui.sar_width = avctx->sample_aspect_ratio.num;
-- 
1.7.9.5



More information about the ffmpeg-devel mailing list