Commit 9fc1668d authored by Max Kellermann's avatar Max Kellermann

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.
parent e9190f42
......@@ -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
......
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