mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-04 13:30:08 -05:00
More generic support for poll descriptors
This commit is contained in:
parent
a86efa083c
commit
460660d4b4
25 changed files with 162 additions and 68 deletions
|
|
@ -146,12 +146,26 @@ int snd_seq_close(snd_seq_t *seq)
|
|||
/*
|
||||
* returns the file descriptor of the client
|
||||
*/
|
||||
int snd_seq_poll_descriptor(snd_seq_t *seq)
|
||||
int _snd_seq_poll_descriptor(snd_seq_t *seq)
|
||||
{
|
||||
assert(seq);
|
||||
return seq->poll_fd;
|
||||
}
|
||||
|
||||
int snd_seq_poll_descriptors(snd_seq_t *seq, struct pollfd *pfds, unsigned int space)
|
||||
{
|
||||
assert(seq);
|
||||
if (space >= 1) {
|
||||
pfds->fd = seq->poll_fd;
|
||||
pfds->events = 0;
|
||||
if (seq->streams & SND_SEQ_OPEN_INPUT)
|
||||
pfds->events |= POLLIN;
|
||||
if (seq->streams & SND_SEQ_OPEN_OUTPUT)
|
||||
pfds->events |= POLLOUT;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* set blocking behavior
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue