summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-04-02 00:42:54 +0200
committerwm4 <wm4@nowhere>2015-04-02 00:42:54 +0200
commitbf69edb1c2bac2ac11343d8e086f0540a0e4b5df (patch)
tree6f801344d65e4eb7c625099f3c0c5c3cd8e789b0
parent83bd1280166117cd7aa40fc91a0e5e227fa68aef (diff)
downloadmpv-bf69edb1c2bac2ac11343d8e086f0540a0e4b5df.tar.bz2
mpv-bf69edb1c2bac2ac11343d8e086f0540a0e4b5df.tar.xz
af_lavrresample: always normalize (libswresample is stupid)
libswresample doesn't normalize when remixing to a float format. This will cause clipping due to float samples being out of the allowed range. Fortunately this extremely bad default can be changed. This does not happen with libavresample: it normalizes by default. Fixes #1752.
-rw-r--r--audio/filter/af_lavrresample.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/audio/filter/af_lavrresample.c b/audio/filter/af_lavrresample.c
index 48f69b72e8..7ccfc5c593 100644
--- a/audio/filter/af_lavrresample.c
+++ b/audio/filter/af_lavrresample.c
@@ -200,6 +200,10 @@ static int configure_lavrr(struct af_instance *af, struct mp_audio *in,
av_opt_set_double(s->avrctx, "cutoff", s->ctx.cutoff, 0);
+#if HAVE_LIBSWRESAMPLE
+ av_opt_set_double(s->avrctx, "rematrix_maxval", 1.0, 0);
+#endif
+
if (mp_set_avopts(af->log, s->avrctx, s->avopts) < 0)
return AF_ERROR;