output/alsa: hold back snd_pcm_writei() until period_buffer is full

This gives MPD more control, because attempts to avoid having partial
periods in the ALSA period buffer.  For example, this means that
DrainInternal() doesn't need to generate silence to fill the partial
period.
This commit is contained in:
Max Kellermann 2019-06-27 15:40:07 +02:00
parent e9190f4249
commit 9fc1668de3
1 changed files with 1 additions and 1 deletions

View File

@ -956,7 +956,7 @@ try {
CopyRingToPeriodBuffer();
if (period_buffer.IsEmpty()) {
if (!period_buffer.IsFull()) {
if (snd_pcm_state(pcm) == SND_PCM_STATE_PREPARED ||
snd_pcm_avail(pcm) <= max_avail_frames) {
/* at SND_PCM_STATE_PREPARED (not yet switched