aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/libx264.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-06-12 01:03:46 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-06-12 01:20:07 +0200
commit3a1c8951bc886e8af30e09dc0e20491f6f5c3937 (patch)
tree1e55f9146aa3a3cc9128faa8f4617df54739ad22 /libavcodec/libx264.c
parent8159fe255ccadbb81c52f192f48d9dc6fc3e5537 (diff)
downloadffmpeg-3a1c8951bc886e8af30e09dc0e20491f6f5c3937.tar.gz
avcodec/libx264: fix "bitrate reconfiguration"
Diffstat (limited to 'libavcodec/libx264.c')
-rw-r--r--libavcodec/libx264.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index 0b304cbe10..5d1e203a7f 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -208,18 +208,20 @@ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame,
}
if (x4->params.rc.i_rc_method == X264_RC_CRF &&
+ x4->crf >= 0 &&
x4->params.rc.f_rf_constant != x4->crf) {
x4->params.rc.f_rf_constant = x4->crf;
x264_encoder_reconfig(x4->enc, &x4->params);
}
if (x4->params.rc.i_rc_method == X264_RC_CQP &&
+ x4->cqp >= 0 &&
x4->params.rc.i_qp_constant != x4->cqp) {
x4->params.rc.i_qp_constant = x4->cqp;
x264_encoder_reconfig(x4->enc, &x4->params);
}
- if (x4->crf_max &&
+ if (x4->crf_max >= 0 &&
x4->params.rc.f_rf_constant_max != x4->crf_max) {
x4->params.rc.f_rf_constant_max = x4->crf_max;
x264_encoder_reconfig(x4->enc, &x4->params);