diff --git a/NEWS b/NEWS index 179ad5f28..002ef277f 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,7 @@ ver 0.21.3 (not yet released) * output - alsa: fix crash bug - alsa: fix stuttering at start of playback + - alsa: fix discarded samples at end of song - alsa: clear error after reopening device * log: default to journal if MPD was started as systemd service diff --git a/src/output/plugins/AlsaOutputPlugin.cxx b/src/output/plugins/AlsaOutputPlugin.cxx index 7f403265c..4cf0c3bd2 100644 --- a/src/output/plugins/AlsaOutputPlugin.cxx +++ b/src/output/plugins/AlsaOutputPlugin.cxx @@ -749,11 +749,10 @@ AlsaOutput::DrainInternal() snd_strerror(-frames_written)); } - if (!period_buffer.IsEmpty()) - /* need to call WriteFromPeriodBuffer() again - in the next iteration, so don't finish the - drain just yet */ - return false; + /* need to call CopyRingToPeriodBuffer() and + WriteFromPeriodBuffer() again in the next + iteration, so don't finish the drain just yet */ + return period_buffer.IsEmpty(); } /* .. and finally drain the ALSA hardware buffer */