]> git.sesse.net Git - ffmpeg/commitdiff
lavc/vaapi_encode_mpeg2: fix frame rate calc error when use time_base.
authorJun Zhao <jun.zhao@intel.com>
Wed, 6 Sep 2017 03:07:15 +0000 (23:07 -0400)
committerMark Thompson <sw@jkqxz.net>
Sat, 9 Sep 2017 10:31:46 +0000 (11:31 +0100)
fix frame rate calc error when use time_base.

Signed-off-by: Yun Zhou <yunx.z.zhou@intel.com>
Signed-off-by: Jun Zhao <jun.zhao@intel.com>
Signed-off-by: Mark Thompson <sw@jkqxz.net>
libavcodec/vaapi_encode_mpeg2.c

index fbddfa5d5a8ee83e16b42f9e890db0b0242becc8..dc918884e89ccb5bbbbe6b9db52f363c97a609af 100644 (file)
@@ -208,7 +208,7 @@ static int vaapi_encode_mpeg2_init_sequence_params(AVCodecContext *avctx)
     if (avctx->framerate.num > 0 && avctx->framerate.den > 0)
         vseq->frame_rate = (float)avctx->framerate.num / avctx->framerate.den;
     else
-        vseq->frame_rate = (float)avctx->time_base.num / avctx->time_base.den;
+        vseq->frame_rate = (float)avctx->time_base.den / avctx->time_base.num;
 
     vseq->aspect_ratio_information = 1;
     vseq->vbv_buffer_size = avctx->rc_buffer_size / (16 * 1024);