diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2016-02-03 15:57:39 +0100 |
---|---|---|
committer | Vittorio Giovara <vittorio.giovara@gmail.com> | 2016-02-08 15:00:29 -0500 |
commit | 5781bfae0cf4271278a8bea176d615cb5c222335 (patch) | |
tree | 2997b9247adc7f95ba82eb2bdf30672dea1e3da6 | |
parent | 2e6ba1993ef41af4a224e854077e4ba4d30f246b (diff) | |
download | ffmpeg-5781bfae0cf4271278a8bea176d615cb5c222335.tar.gz |
flacenc: Load default prediction_order parameters if none is selected
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
-rw-r--r-- | libavcodec/flacenc.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libavcodec/flacenc.c b/libavcodec/flacenc.c index 81c3bb698a..d05a0c673c 100644 --- a/libavcodec/flacenc.c +++ b/libavcodec/flacenc.c @@ -305,8 +305,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, |