From 480bbc9067da7cce3400cf3988bf5fdfa4d9fa3f Mon Sep 17 00:00:00 2001 From: Anton Mitrofanov Date: Fri, 12 Oct 2012 23:43:40 +0400 Subject: [PATCH] Fix reconfiguring to crf=0 Lossless mode can't currently be enabled mid-stream. --- encoder/encoder.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.39.2