From bf69edb1c2bac2ac11343d8e086f0540a0e4b5df Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 2 Apr 2015 00:42:54 +0200 Subject: 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. --- audio/filter/af_lavrresample.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'audio/filter/af_lavrresample.c') 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; -- cgit v1.2.3