Commit 6c2a6a65 authored by Max Kellermann's avatar Max Kellermann

output/alsa: remove snd_pcm_state() check from DrainInternal()

This check was added 9 years ago in commit 4dc25d39 to work around a dmix bug which I assume has been fixed long ago. Removing this fixes another corner case: if draining is requested before the start threshold is reached, the PCM is still in SND_PCM_STATE_PREPARED but not yet SND_PCM_STATE_RUNNING, which means the submitted data will never be played. This corner case is realistic when playing songs shorter than the ALSA buffer (if the buffer is very large).
parent 4247a757
......@@ -712,11 +712,6 @@ AlsaOutput::Recover(int err) noexcept
inline bool
AlsaOutput::DrainInternal() noexcept
{
if (snd_pcm_state(pcm) != SND_PCM_STATE_RUNNING) {
CancelInternal();
return true;
}
/* drain ring_buffer */
CopyRingToPeriodBuffer();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment