From bc9eb41ea2cbe9a19e5d63ddc9e09ed5e7d1b77a Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 3 Sep 2008 02:53:10 +0200 Subject: 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. --- pulse/ctl_pulse.c | 45 ++------------------------------------------- 1 file changed, 2 insertions(+), 43 deletions(-) (limited to 'pulse') 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; -- cgit