summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2018-11-14 09:48:24 +0100
committerMax Kellermann <max@musicpd.org>2018-11-14 09:48:24 +0100
commit6c2a6a65e0adb1961c8d79dbdf30739cafcbd811 (patch)
treee78091dc87e137ce1d96dda8e4088440e91287d0 /src
parent4247a757b3a9725f3327edf11c822e6b0a4f51dc (diff)
output/alsa: remove snd_pcm_state() check from DrainInternal()
This check was added 9 years ago in commit 4dc25d3908648cc781fe43e54243bb64aec4b2cb 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).
Diffstat (limited to 'src')
-rw-r--r--src/output/plugins/AlsaOutputPlugin.cxx5
1 files changed, 0 insertions, 5 deletions
diff --git a/src/output/plugins/AlsaOutputPlugin.cxx b/src/output/plugins/AlsaOutputPlugin.cxx
index 00de0af18..841b12b8c 100644
--- a/src/output/plugins/AlsaOutputPlugin.cxx
+++ b/src/output/plugins/AlsaOutputPlugin.cxx
@@ -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();