mirror of
https://github.com/mpv-player/mpv.git
synced 2025-12-28 05:33:14 +00:00
There is a condition here that is supposed to wait until the ao is finished playing before it goes through the rest of this function and actually starts the reinit of the audio chain. This is not needed however and actually causes a bug. uninit_audio_out already takes the gapless audio case into account and drains the audio before preceding. There is no reason to bail here. Additionally, returning early here actually breaks ao_alsa. ao_alsa is pretty dumb and not able to cope with changing samplerates. It explictly needs to stop the PCM and then start it again for it to work. The old code here ensured the ao would never reinit itself and then would wait forever trying to play samples with no actual data. Other AOs (pipewire and pulse) seem to be able to cope with this and reinit themselves in other ways (didn't look in detail). This change makes no difference for them. Note that in many cases, this appeared to work on ALSA because there is a high likelihood that your default audio device will choose a 48 kHz sampling rate and thus your entire playlist is resampled to 48 kHz which avoids the bug. Fixes #15477.
31 KiB
31 KiB