[6/7] nvenc: Use the framerate information

Message ID 20180216170209.52876-7-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.
Unbreak the rate-control behaviour.
---
 libavcodec/nvenc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Patch

diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c
index a7171e4b17..53cb5f974e 100644
--- a/libavcodec/nvenc.c
+++ b/libavcodec/nvenc.c
@@ -946,8 +946,8 @@  static int nvenc_setup_encoder(AVCodecContext *avctx)
                   1024 * 1024);
     }
 
-    ctx->params.frameRateNum = avctx->time_base.den;
-    ctx->params.frameRateDen = avctx->time_base.num * avctx->ticks_per_frame;
+    ctx->params.frameRateNum = avctx->framerate.num;
+    ctx->params.frameRateDen = avctx->framerate.den * avctx->ticks_per_frame;
 
     ctx->params.enableEncodeAsync = 0;
     ctx->params.enablePTD         = 1;