The following patch will make snd_pcm_poll_descriptors_revents()
return the correct value when used on a jack plugin device.
The current version returns POLLIN regardless of capture or
playback.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
return 0;
}
-static int snd_pcm_jack_poll_revents(snd_pcm_ioplug_t *io ATTRIBUTE_UNUSED,
+static int snd_pcm_jack_poll_revents(snd_pcm_ioplug_t *io,
struct pollfd *pfds, unsigned int nfds,
unsigned short *revents)
{
read(pfds[0].fd, buf, 1);
- *revents = pfds[0].revents;
+ *revents = pfds[0].revents & ~(POLLIN | POLLOUT);
+ if (pfds[0].revents & POLLIN)
+ *revents |= (io->stream == SND_PCM_STREAM_PLAYBACK) ? POLLOUT : POLLIN;
return 0;
}