A next try to fix the snd_pcm_wait() behaviour with direct plugins

This commit is contained in:
Jaroslav Kysela 2004-03-24 08:50:01 +00:00
parent f2175f1384
commit f5a5284c6d
2 changed files with 17 additions and 11 deletions

View file

@ -427,6 +427,7 @@ int snd_pcm_direct_poll_revents(snd_pcm_t *pcm, struct pollfd *pfds, unsigned in
events = pfds[0].revents;
if (events & POLLIN) {
int empty = 0;
snd_pcm_avail_update(pcm);
if (pcm->stream == SND_PCM_STREAM_PLAYBACK) {
events |= POLLOUT;
events &= ~POLLIN;
@ -436,6 +437,8 @@ int snd_pcm_direct_poll_revents(snd_pcm_t *pcm, struct pollfd *pfds, unsigned in
}
/* empty the timer read queue */
while (empty && snd_timer_read(dmix->timer, &rbuf, sizeof(rbuf)) == sizeof(rbuf)) ;
if (empty)
events &= ~(POLLOUT|POLLIN);
}
*revents = events;
return 0;