diff options
author | Timo Rothenpieler <timo@rothenpieler.org> | 2022-11-02 19:02:56 +0100 |
---|---|---|
committer | Timo Rothenpieler <timo@rothenpieler.org> | 2022-11-05 18:35:33 +0100 |
commit | 28680e2f41b93b75863720e42397441dfcc29f94 (patch) | |
tree | cf8d5b19d53e1f8240ae5bca3f41ce68cea4890a /libavcodec/nvenc.c | |
parent | e8850bc2a8590ac66346de7a6d4831d1778746d1 (diff) | |
download | ffmpeg-28680e2f41b93b75863720e42397441dfcc29f94.tar.gz |
avcodec/nvenc: only set b_ref_mode when explicitly requested
Diffstat (limited to 'libavcodec/nvenc.c')
-rw-r--r-- | libavcodec/nvenc.c | 6 |
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 |