summaryrefslogtreecommitdiffstats
path: root/audio/filter/af_lavrresample.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-01-20 17:14:04 +0100
committerwm4 <wm4@nowhere>2016-01-20 17:14:04 +0100
commitac966ded11e22754ffa43b390e599e4242e29b37 (patch)
tree34f1f5072201263fac366231fbca58a10bb9767c /audio/filter/af_lavrresample.c
parent930b0d1cf6f2ffa6bf3df516e120a395e1c60342 (diff)
downloadmpv-ac966ded11e22754ffa43b390e599e4242e29b37.tar.bz2
mpv-ac966ded11e22754ffa43b390e599e4242e29b37.tar.xz
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.
Diffstat (limited to 'audio/filter/af_lavrresample.c')
-rw-r--r--audio/filter/af_lavrresample.c12
1 files changed, 8 insertions, 4 deletions
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}
},