mirror of https://github.com/mpv-player/mpv
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:
parent
83bd128016
commit
bf69edb1c2
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue