Fix poll after XRUN with dmix

Fix the behavior of poll after XRUN with dmix plugin.
Poll should return immediately with an XRUN stream.
This commit is contained in:
Takashi Iwai 2005-05-23 08:48:46 +00:00
parent b0ee34e757
commit 4c6809bf30
2 changed files with 8 additions and 6 deletions

View file

@ -312,7 +312,7 @@ static int _snd_pcm_dmix_sync_ptr(snd_pcm_t *pcm, int do_slave_sync)
dmix->avail_max = avail;
if (avail >= pcm->stop_threshold) {
struct timeval tv;
snd_pcm_direct_timer_stop(dmix);
snd_timer_stop(dmix->timer);
gettimeofday(&tv, 0);
dmix->trigger_tstamp.tv_sec = tv.tv_sec;
dmix->trigger_tstamp.tv_nsec = tv.tv_usec * 1000L;
@ -321,6 +321,8 @@ static int _snd_pcm_dmix_sync_ptr(snd_pcm_t *pcm, int do_slave_sync)
return -EPIPE;
}
dmix->state = SND_PCM_STATE_SETUP;
/* clear queue to remove pending poll events */
snd_pcm_direct_clear_timer_queue(dmix);
}
return 0;
}