[5/7] qsv: Simplify the framerate setup

Message ID 20180216170209.52876-6-lu_zero@gentoo.org
State New
Headers show
Series
  • [1/7] avcodec: Always fill the encoder target framerate
Related show

Commit Message

Luca Barbato Feb. 16, 2018, 5:02 p.m.
Now the framerate field is always populated.
---
 libavcodec/qsvenc.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

Patch

diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
index 24d9ec4d71..bb1494949e 100644
--- a/libavcodec/qsvenc.c
+++ b/libavcodec/qsvenc.c
@@ -402,13 +402,8 @@  static int init_video_param_jpeg(AVCodecContext *avctx, QSVEncContext *q)
         q->param.mfx.FrameInfo.Height = frames_hwctx->surfaces[0].Info.Height;
     }
 
-    if (avctx->framerate.den > 0 && avctx->framerate.num > 0) {
-        q->param.mfx.FrameInfo.FrameRateExtN = avctx->framerate.num;
-        q->param.mfx.FrameInfo.FrameRateExtD = avctx->framerate.den;
-    } else {
-        q->param.mfx.FrameInfo.FrameRateExtN  = avctx->time_base.den;
-        q->param.mfx.FrameInfo.FrameRateExtD  = avctx->time_base.num;
-    }
+    q->param.mfx.FrameInfo.FrameRateExtN = avctx->framerate.num;
+    q->param.mfx.FrameInfo.FrameRateExtD = avctx->framerate.den;
 
     q->param.mfx.Interleaved          = 1;
     q->param.mfx.Quality              = av_clip(avctx->global_quality, 1, 100);