mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-05 13:30:00 -05: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
|
|
@ -599,6 +599,28 @@ int snd_mixer_poll_descriptors(snd_mixer_t *mixer, struct pollfd *pfds, unsigned
|
|||
return count;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief get returned events from poll descriptors
|
||||
* \param mixer Mixer 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_mixer_poll_descriptors_revents(snd_mixer_t *mixer, struct pollfd *pfds, unsigned int nfds, unsigned short *revents)
|
||||
{
|
||||
unsigned int idx;
|
||||
unsigned short res;
|
||||
assert(mixer && pfds && revents);
|
||||
if (nfds == 0)
|
||||
return -EINVAL;
|
||||
res = 0;
|
||||
for (idx = 0; idx < nfds; idx++)
|
||||
res |= pfds->revents & (POLLIN|POLLERR);
|
||||
*revents = res;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Wait for a mixer to become ready (i.e. at least one event pending)
|
||||
* \param mixer Mixer handle
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue