mirror of
https://gitlab.freedesktop.org/pipewire/pipewire
synced 2024-07-21 18:26:24 +00:00
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.
This commit is contained in:
parent
266ef3b986
commit
92330b9de3
|
@ -159,15 +159,6 @@ static int snd_pcm_pipewire_close(snd_pcm_ioplug_t *io)
|
||||||
return 0;
|
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,
|
static int snd_pcm_pipewire_poll_revents(snd_pcm_ioplug_t *io,
|
||||||
struct pollfd *pfds, unsigned int nfds,
|
struct pollfd *pfds, unsigned int nfds,
|
||||||
unsigned short *revents)
|
unsigned short *revents)
|
||||||
|
@ -179,10 +170,8 @@ static int snd_pcm_pipewire_poll_revents(snd_pcm_ioplug_t *io,
|
||||||
if (pw->error < 0)
|
if (pw->error < 0)
|
||||||
return pw->error;
|
return pw->error;
|
||||||
|
|
||||||
update_active(io);
|
|
||||||
|
|
||||||
*revents = pfds[0].revents & ~(POLLIN | POLLOUT);
|
*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;
|
*revents |= (io->stream == SND_PCM_STREAM_PLAYBACK) ? POLLOUT : POLLIN;
|
||||||
|
|
||||||
pw_log_trace_fp("poll %d", *revents);
|
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,
|
.delay = snd_pcm_pipewire_delay,
|
||||||
.drain = snd_pcm_pipewire_drain,
|
.drain = snd_pcm_pipewire_drain,
|
||||||
.prepare = snd_pcm_pipewire_prepare,
|
.prepare = snd_pcm_pipewire_prepare,
|
||||||
.poll_descriptors = snd_pcm_pipewire_poll_descriptors,
|
|
||||||
.poll_revents = snd_pcm_pipewire_poll_revents,
|
.poll_revents = snd_pcm_pipewire_poll_revents,
|
||||||
.hw_params = snd_pcm_pipewire_hw_params,
|
.hw_params = snd_pcm_pipewire_hw_params,
|
||||||
.sw_params = snd_pcm_pipewire_sw_params,
|
.sw_params = snd_pcm_pipewire_sw_params,
|
||||||
|
|
Loading…
Reference in a new issue