summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYour Name <you@example.com>2021-05-07 14:49:36 +0200
committerYour Name <you@example.com>2021-05-07 15:01:15 +0200
commit3f7d3d5804ef3dd76eb1aa76210619f96244920d (patch)
treea1d065497b5eb1fa6cd05d4fa279d3702f0fb7f4
parentfce994bdc473e73873fb8e9f4841004d073f43b4 (diff)
downloadmpv-3f7d3d5804ef3dd76eb1aa76210619f96244920d.tar.bz2
mpv-3f7d3d5804ef3dd76eb1aa76210619f96244920d.tar.xz
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".
-rw-r--r--player/audio.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/player/audio.c b/player/audio.c
index c468df6719..307909c260 100644
--- a/player/audio.c
+++ b/player/audio.c
@@ -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)