Browse code

In libx264 wrapper, fix side effect with has_b_frames, bframe_pyramid can be set when bframe is not.

Baptiste Coudurier authored on 2011/04/24 04:41:11
Showing 1 changed files
... ...
@@ -366,7 +366,8 @@ static av_cold int X264_init(AVCodecContext *avctx)
366 366
         x4->params.b_repeat_headers = 0;
367 367
 
368 368
     // update AVCodecContext with x264 parameters
369
-    avctx->has_b_frames = x4->params.i_bframe_pyramid ? 2 : !!x4->params.i_bframe;
369
+    avctx->has_b_frames = x4->params.i_bframe ?
370
+        x4->params.i_bframe_pyramid ? 2 : 1 : 0;
370 371
     avctx->bit_rate = x4->params.rc.i_bitrate*1000;
371 372
     avctx->crf = x4->params.rc.f_rf_constant;
372 373