From ac966ded11e22754ffa43b390e599e4242e29b37 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 20 Jan 2016 17:14:04 +0100 Subject: audio: change downmix behavior, add --audio-normalize-downmix This is probably the 3rd time the user-visible behavior changes. This time, switch back because not normalizing seems to be the more expected behavior from users. --- audio/filter/af_lavrresample.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'audio/filter/af_lavrresample.c') diff --git a/audio/filter/af_lavrresample.c b/audio/filter/af_lavrresample.c index 477443cefc..0c175a42e4 100644 --- a/audio/filter/af_lavrresample.c +++ b/audio/filter/af_lavrresample.c @@ -261,10 +261,13 @@ static int configure_lavrr(struct af_instance *af, struct mp_audio *in, av_opt_set_double(s->avrctx, "cutoff", s->opts.cutoff, 0); + int normalize = s->opts.normalize; + if (normalize < 0) + normalize = af->opts->audio_normalize; #if HAVE_LIBSWRESAMPLE - av_opt_set_double(s->avrctx, "rematrix_maxval", s->opts.normalize ? 1 : 1000, 0); + av_opt_set_double(s->avrctx, "rematrix_maxval", normalize ? 1 : 1000, 0); #else - av_opt_set_int(s->avrctx, "normalize_mix_level", s->opts.normalize, 0); + av_opt_set_int(s->avrctx, "normalize_mix_level", !!normalize, 0); #endif if (mp_set_avopts(af->log, s->avrctx, s->avopts) < 0) @@ -616,7 +619,7 @@ const struct af_info af_info_lavrresample = { .filter_size = 16, .cutoff = 0.0, .phase_shift = 10, - .normalize = 1, + .normalize = -1, }, .playback_speed = 1.0, .allow_detach = 1, @@ -627,7 +630,8 @@ const struct af_info af_info_lavrresample = { OPT_FLAG("linear", opts.linear, 0), OPT_DOUBLE("cutoff", opts.cutoff, M_OPT_RANGE, .min = 0, .max = 1), OPT_FLAG("detach", allow_detach, 0), - OPT_FLAG("normalize", opts.normalize, 0), + OPT_CHOICE("normalize", opts.normalize, 0, + ({"no", 0}, {"yes", 1}, {"auto", -1})), OPT_KEYVALUELIST("o", avopts, 0), {0} }, -- cgit v1.2.3