Fixed the drain of dmix plugin without any data.
It should return immediately.
return -EBADFD;
if (pcm->mode & SND_PCM_NONBLOCK)
return -EAGAIN;
- if (dmix->state == SND_PCM_STATE_PREPARED &&
- snd_pcm_mmap_playback_hw_avail(pcm) > 0)
- snd_pcm_dmix_start(pcm);
+ if (dmix->state == SND_PCM_STATE_PREPARED) {
+ if (snd_pcm_mmap_playback_hw_avail(pcm) > 0)
+ snd_pcm_dmix_start(pcm);
+ else {
+ snd_pcm_dmix_drop(pcm);
+ return 0;
+ }
+ }
stop_threshold = pcm->stop_threshold;
if (pcm->stop_threshold > pcm->buffer_size)
pcm->stop_threshold = pcm->buffer_size;