mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-31 22:25:35 -04:00
Added snd_*_poll_descriptors_revents functions.
This commit is contained in:
parent
23ab0b3509
commit
ddb7209e9a
15 changed files with 195 additions and 36 deletions
|
|
@ -305,11 +305,11 @@ int snd_seq_poll_descriptors(snd_seq_t *seq, struct pollfd *pfds, unsigned int s
|
|||
assert(seq);
|
||||
if ((events & POLLIN) && space >= 1) {
|
||||
assert(seq->streams & SND_SEQ_OPEN_INPUT);
|
||||
revents |= POLLIN;
|
||||
revents |= POLLIN|POLLERR;
|
||||
}
|
||||
if ((events & POLLOUT) && space >= 1) {
|
||||
assert(seq->streams & SND_SEQ_OPEN_INPUT);
|
||||
revents |= POLLOUT;
|
||||
revents |= POLLOUT|POLLERR;
|
||||
}
|
||||
if (!revents)
|
||||
return 0;
|
||||
|
|
@ -318,6 +318,24 @@ int snd_seq_poll_descriptors(snd_seq_t *seq, struct pollfd *pfds, unsigned int s
|
|||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief get returned events from poll descriptors
|
||||
* \param seq sequencer handle
|
||||
* \param pfds array of poll descriptors
|
||||
* \param nfds count of poll descriptors
|
||||
* \param revents returned events
|
||||
* \return zero if success, otherwise a negative error code
|
||||
*/
|
||||
int snd_seq_poll_descriptors_revents(snd_seq_t *seq, struct pollfd *pfds, unsigned int nfds, unsigned short *revents)
|
||||
{
|
||||
assert(seq && pfds && revents);
|
||||
if (nfds == 1) {
|
||||
*revents = pfds->revents;
|
||||
return 0;
|
||||
}
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Set nonblock mode
|
||||
* \param seq sequencer handle
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue