mirror of https://github.com/mpv-player/mpv
audio: fix replaygain volume scale
The new replaygain code accidentally applied the linear gain as cubic volume level. Fix this by moving the computation of the volume scale out of the af_volume filter. (Still haven't verified whether the replaygain code works correctly.)
This commit is contained in:
parent
f1c4d20e65
commit
90a1ca02a2
|
@ -106,7 +106,7 @@ static int control(struct af_instance *af, int cmd, void *arg)
|
|||
}
|
||||
case AF_CONTROL_SET_VOLUME:
|
||||
s->vol = *(float *)arg;
|
||||
s->level = pow(s->vol, 3);
|
||||
s->level = *(float *)arg;
|
||||
MP_VERBOSE(af, "volume gain: %f\n", s->level);
|
||||
return AF_OK;
|
||||
case AF_CONTROL_GET_VOLUME:
|
||||
|
|
|
@ -176,6 +176,7 @@ void audio_update_volume(struct MPContext *mpctx)
|
|||
return;
|
||||
|
||||
float gain = MPMAX(opts->softvol_volume / 100.0, 0);
|
||||
gain = pow(gain, 3);
|
||||
gain *= compute_replaygain(mpctx);
|
||||
if (opts->softvol_mute == 1)
|
||||
gain = 0.0;
|
||||
|
|
Loading…
Reference in New Issue