audio: fix replaygain being completely broken

Switching to a new file while keeping the AO didn't update the volume.
While there's an explicit audio_update_volume() call in
reinit_audio_chain_src(), it doesn't work, because at that point
ao_chain->ao is still NULL, and it does nothing. That's pretty weird and
might cause other problems (what happens if you try to mute while the AO
is "floating"?). Regarding gapless, trying to use the AO gain for
replaygain is also gross nonsense, because the new replaygain computed
gain would affect audio from the previous file. It looks like replaygain
should be in an af_volume filter maybe. On the other hand, I enjoy
setting ridiculous replaygain-preamp values and compensating with a low
volume setting, which would not work well if both gains were applied to
the audio independently.

For now, just add the missing call. This is orthogonal to fixing
replaygain "properly".
This commit is contained in:
Your Name 2021-05-07 14:49:36 +02:00
parent fce994bdc4
commit 3f7d3d5804
1 changed files with 1 additions and 0 deletions

View File

@ -314,6 +314,7 @@ static void ao_chain_set_ao(struct ao_chain *ao_c, struct ao *ao)
mp_async_queue_set_notifier(ao_c->queue_filter, ao_c->ao_filter);
// Make sure filtering never stops with frames stuck in access filter.
mp_filter_set_high_priority(ao_c->queue_filter, true);
audio_update_volume(ao_c->mpctx);
}
if (ao_c->filter->ao_needs_update)