[FFmpeg-cvslog] lavc/vaapi_encode_mpeg2: fix frame rate calc error when use time_base.

Jun Zhao git at videolan.org
Sat Sep 9 13:32:03 EEST 2017


ffmpeg | branch: master | Jun Zhao <jun.zhao at intel.com> | Tue Sep  5 23:07:15 2017 -0400| [a918f16f7ccc7eb75330c97036888cf05c14b311] | committer: Mark Thompson

lavc/vaapi_encode_mpeg2: fix frame rate calc error when use time_base.

fix frame rate calc error when use time_base.

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

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a918f16f7ccc7eb75330c97036888cf05c14b311
---

 libavcodec/vaapi_encode_mpeg2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/vaapi_encode_mpeg2.c b/libavcodec/vaapi_encode_mpeg2.c
index fbddfa5d5a..dc918884e8 100644
--- a/libavcodec/vaapi_encode_mpeg2.c
+++ b/libavcodec/vaapi_encode_mpeg2.c
@@ -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);



More information about the ffmpeg-cvslog mailing list