aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2016-01-31 20:04:17 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2016-01-31 20:05:41 +0100
commit3c8e95ab5da5a1e5ada0379020911d99efe48534 (patch)
tree451b0ab87b19ef4dffea28ed819365e0f04da729
parente9eb8b3ba253830049e2bdedecedc3e69612b8da (diff)
downloadffmpeg-3c8e95ab5da5a1e5ada0379020911d99efe48534.tar.gz
avcodec/flacenc: Fix prediction_order parameter
Fixes regression Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/flacenc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libavcodec/flacenc.c b/libavcodec/flacenc.c
index 6fed138cdf..a91ed19780 100644
--- a/libavcodec/flacenc.c
+++ b/libavcodec/flacenc.c
@@ -315,8 +315,10 @@ static av_cold int flac_encode_init(AVCodecContext *avctx)
FF_LPC_TYPE_LEVINSON, FF_LPC_TYPE_LEVINSON, FF_LPC_TYPE_LEVINSON,
FF_LPC_TYPE_LEVINSON})[level];
- s->options.min_prediction_order = ((int[]){ 2, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1})[level];
- s->options.max_prediction_order = ((int[]){ 3, 4, 4, 6, 8, 8, 8, 8, 12, 12, 12, 32, 32})[level];
+ if (s->options.min_prediction_order < 0)
+ s->options.min_prediction_order = ((int[]){ 2, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1})[level];
+ if (s->options.max_prediction_order < 0)
+ s->options.max_prediction_order = ((int[]){ 3, 4, 4, 6, 8, 8, 8, 8, 12, 12, 12, 32, 32})[level];
if (s->options.prediction_order_method < 0)
s->options.prediction_order_method = ((int[]){ ORDER_METHOD_EST, ORDER_METHOD_EST, ORDER_METHOD_EST,