]> git.sesse.net Git - x264/commitdiff
Fix reconfiguring to crf=0
authorAnton Mitrofanov <BugMaster@narod.ru>
Fri, 12 Oct 2012 19:43:40 +0000 (23:43 +0400)
committerFiona Glaser <fiona@x264.com>
Wed, 7 Nov 2012 22:48:37 +0000 (14:48 -0800)
Lossless mode can't currently be enabled mid-stream.

encoder/encoder.c

index 4a93ac54cdc2950607cf26b01ffafac13a0048e6..69eb02eaf422a19cd3a15cdb5de87e5b1091275e 100644 (file)
@@ -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;