]> git.sesse.net Git - ffmpeg/commitdiff
mfenc: Fix setting has_b_frames for max_b_frames == 1
authorMartin Storsjö <martin@martin.st>
Wed, 20 May 2020 21:11:47 +0000 (00:11 +0300)
committerMartin Storsjö <martin@martin.st>
Fri, 22 May 2020 18:49:37 +0000 (21:49 +0300)
This was a mistake in my own additions in
050b72ab5ef318605b305aa6cb920e8b52f1002e.

Signed-off-by: Martin Storsjö <martin@martin.st>
libavcodec/mfenc.c

index dcc3b32307823585908f943f91466a328fc7ec0f..edee0510b224a58de72a2c0e38f4c9e4a003b24e 100644 (file)
@@ -677,7 +677,7 @@ static int mf_encv_output_adjust(AVCodecContext *avctx, IMFMediaType *type)
         // "scenario" to "camera_record" sets it in CFR mode (where the default
         // is VFR), which makes the encoder avoid dropping frames.
         ICodecAPI_SetValue(c->codec_api, &ff_CODECAPI_AVEncMPVDefaultBPictureCount, FF_VAL_VT_UI4(avctx->max_b_frames));
-        avctx->has_b_frames = avctx->max_b_frames > 1 ? 1 : 0;
+        avctx->has_b_frames = avctx->max_b_frames > 0;
 
         ICodecAPI_SetValue(c->codec_api, &ff_CODECAPI_AVEncH264CABACEnable, FF_VAL_VT_BOOL(1));