From: Anton Mitrofanov Date: Fri, 12 Oct 2012 19:43:40 +0000 (+0400) Subject: Fix reconfiguring to crf=0 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=480bbc9067da7cce3400cf3988bf5fdfa4d9fa3f;p=x264 Fix reconfiguring to crf=0 Lossless mode can't currently be enabled mid-stream. --- diff --git a/encoder/encoder.c b/encoder/encoder.c index 4a93ac54..69eb02ea 100644 --- a/encoder/encoder.c +++ b/encoder/encoder.c @@ -577,7 +577,7 @@ static int x264_validate_parameters( x264_t *h, int b_open ) h->param.rc.i_qp_constant = h->param.rc.f_rf_constant + QP_BD_OFFSET; h->param.rc.i_bitrate = 0; } - if( (h->param.rc.i_rc_method == X264_RC_CQP || h->param.rc.i_rc_method == X264_RC_CRF) + if( b_open && (h->param.rc.i_rc_method == X264_RC_CQP || h->param.rc.i_rc_method == X264_RC_CRF) && h->param.rc.i_qp_constant == 0 ) { h->mb.b_lossless = 1;