summaryrefslogtreecommitdiffstats
path: root/pulse
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2008-09-03 02:53:10 +0200
committerLennart Poettering <lennart@poettering.net>2008-09-03 20:25:37 +0200
commitbc9eb41ea2cbe9a19e5d63ddc9e09ed5e7d1b77a (patch)
tree1e0e9cf28ed82cba1a612164fcdb4d29ad8b0a9f /pulse
parent2a91715c4643fd5cd9cccce0c2aa56cc493e75ce (diff)
Drop our own implementation of the poll() callbacks
The ctl extension interfaces support poll() via a single file descriptor anyway, so let's use it instead of rolling our own poll support callbacks.
Diffstat (limited to 'pulse')
-rw-r--r--pulse/ctl_pulse.c45
1 files changed, 2 insertions, 43 deletions
diff --git a/pulse/ctl_pulse.c b/pulse/ctl_pulse.c
index 61ec01f..0b10628 100644
--- a/pulse/ctl_pulse.c
+++ b/pulse/ctl_pulse.c
@@ -513,46 +513,6 @@ static int pulse_read_event(snd_ctl_ext_t * ext, snd_ctl_elem_id_t * id,
return err;
}
-static int pulse_ctl_poll_descriptors_count(snd_ctl_ext_t * ext)
-{
- snd_ctl_pulse_t *ctl = ext->private_data;
- int count;
-
- assert(ctl);
- assert(ctl->p);
-
- pa_threaded_mainloop_lock(ctl->p->mainloop);
-
- count = pulse_poll_descriptors_count(ctl->p);
-
- pa_threaded_mainloop_unlock(ctl->p->mainloop);
-
- return count;
-}
-
-static int pulse_ctl_poll_descriptors(snd_ctl_ext_t * ext,
- struct pollfd *pfd,
- unsigned int space)
-{
- int num;
-
- snd_ctl_pulse_t *ctl = ext->private_data;
-
- assert(ctl);
- assert(ctl->p);
-
- pa_threaded_mainloop_lock(ctl->p->mainloop);
-
- num = pulse_poll_descriptors(ctl->p, pfd, space);
- if (num < 0)
- goto finish;
-
- finish:
- pa_threaded_mainloop_unlock(ctl->p->mainloop);
-
- return num;
-}
-
static int pulse_ctl_poll_revents(snd_ctl_ext_t * ext, struct pollfd *pfd,
unsigned int nfds,
unsigned short *revents)
@@ -602,8 +562,6 @@ static const snd_ctl_ext_callback_t pulse_ext_callback = {
.write_integer = pulse_write_integer,
.subscribe_events = pulse_subscribe_events,
.read_event = pulse_read_event,
- .poll_descriptors_count = pulse_ctl_poll_descriptors_count,
- .poll_descriptors = pulse_ctl_poll_descriptors,
.poll_revents = pulse_ctl_poll_revents,
.close = pulse_close,
};
@@ -756,7 +714,8 @@ SND_CTL_PLUGIN_DEFINE_FUNC(pulse)
sizeof(ctl->ext.longname) - 1);
strncpy(ctl->ext.mixername, "PulseAudio",
sizeof(ctl->ext.mixername) - 1);
- ctl->ext.poll_fd = -1;
+ ctl->ext.poll_fd = ctl->p->main_fd;
+
ctl->ext.callback = &pulse_ext_callback;
ctl->ext.private_data = ctl;