From 92330b9de341c3b7bc537d2f42687b65c7ceb527 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 15 Nov 2023 16:35:17 +0100 Subject: [PATCH] alsa: the default poll_descriptors is good now Remove our custom poll_descriptors function because the default is enough now that we update from revents. --- pipewire-alsa/alsa-plugins/pcm_pipewire.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/pipewire-alsa/alsa-plugins/pcm_pipewire.c b/pipewire-alsa/alsa-plugins/pcm_pipewire.c index 15e78d823..3464692dc 100644 --- a/pipewire-alsa/alsa-plugins/pcm_pipewire.c +++ b/pipewire-alsa/alsa-plugins/pcm_pipewire.c @@ -159,15 +159,6 @@ static int snd_pcm_pipewire_close(snd_pcm_ioplug_t *io) return 0; } -static int snd_pcm_pipewire_poll_descriptors(snd_pcm_ioplug_t *io, struct pollfd *pfds, unsigned int space) -{ - snd_pcm_pipewire_t *pw = io->private_data; - update_active(io); - pfds->fd = pw->fd; - pfds->events = POLLIN | POLLERR | POLLNVAL; - return 1; -} - static int snd_pcm_pipewire_poll_revents(snd_pcm_ioplug_t *io, struct pollfd *pfds, unsigned int nfds, unsigned short *revents) @@ -179,10 +170,8 @@ static int snd_pcm_pipewire_poll_revents(snd_pcm_ioplug_t *io, if (pw->error < 0) return pw->error; - update_active(io); - *revents = pfds[0].revents & ~(POLLIN | POLLOUT); - if (pfds[0].revents & POLLIN && pw->active) + if (pfds[0].revents & POLLIN && update_active(io)) *revents |= (io->stream == SND_PCM_STREAM_PLAYBACK) ? POLLOUT : POLLIN; pw_log_trace_fp("poll %d", *revents); @@ -910,7 +899,6 @@ static snd_pcm_ioplug_callback_t pipewire_pcm_callback = { .delay = snd_pcm_pipewire_delay, .drain = snd_pcm_pipewire_drain, .prepare = snd_pcm_pipewire_prepare, - .poll_descriptors = snd_pcm_pipewire_poll_descriptors, .poll_revents = snd_pcm_pipewire_poll_revents, .hw_params = snd_pcm_pipewire_hw_params, .sw_params = snd_pcm_pipewire_sw_params,