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.
This commit is contained in:
wm4 2015-04-02 00:42:54 +02:00
parent 83bd128016
commit bf69edb1c2
1 changed files with 4 additions and 0 deletions

View File

@ -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;