aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/nvenc.c
diff options
context:
space:
mode:
authorTimo Rothenpieler <timo@rothenpieler.org>2022-11-02 19:02:56 +0100
committerTimo Rothenpieler <timo@rothenpieler.org>2022-11-05 18:35:33 +0100
commit28680e2f41b93b75863720e42397441dfcc29f94 (patch)
treecf8d5b19d53e1f8240ae5bca3f41ce68cea4890a /libavcodec/nvenc.c
parente8850bc2a8590ac66346de7a6d4831d1778746d1 (diff)
downloadffmpeg-28680e2f41b93b75863720e42397441dfcc29f94.tar.gz
avcodec/nvenc: only set b_ref_mode when explicitly requested
Diffstat (limited to 'libavcodec/nvenc.c')
-rw-r--r--libavcodec/nvenc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c
index 3c6fce391d..73c05fcd37 100644
--- a/libavcodec/nvenc.c
+++ b/libavcodec/nvenc.c
@@ -1199,7 +1199,8 @@ static av_cold int nvenc_setup_h264_config(AVCodecContext *avctx)
h264->entropyCodingMode = ctx->coder;
#ifdef NVENC_HAVE_BFRAME_REF_MODE
- h264->useBFramesAsRef = ctx->b_ref_mode;
+ if (ctx->b_ref_mode >= 0)
+ h264->useBFramesAsRef = ctx->b_ref_mode;
#endif
#ifdef NVENC_HAVE_MULTIPLE_REF_FRAMES
@@ -1314,7 +1315,8 @@ static av_cold int nvenc_setup_hevc_config(AVCodecContext *avctx)
hevc->tier = ctx->tier;
#ifdef NVENC_HAVE_HEVC_BFRAME_REF_MODE
- hevc->useBFramesAsRef = ctx->b_ref_mode;
+ if (ctx->b_ref_mode >= 0)
+ hevc->useBFramesAsRef = ctx->b_ref_mode;
#endif
#ifdef NVENC_HAVE_MULTIPLE_REF_FRAMES