mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-23 06:59:58 -05:00
Fix REMOVE_POLL
This commit is contained in:
parent
7aa79a2a0d
commit
ac3cd24d5c
1 changed files with 15 additions and 4 deletions
|
|
@ -403,12 +403,23 @@ on_node_event (SpaNode *node, SpaEvent *event, void *user_data)
|
||||||
case SPA_EVENT_TYPE_REMOVE_POLL:
|
case SPA_EVENT_TYPE_REMOVE_POLL:
|
||||||
{
|
{
|
||||||
SpaPollItem *poll = event->data;
|
SpaPollItem *poll = event->data;
|
||||||
|
unsigned int i;
|
||||||
|
|
||||||
g_debug ("node %p: remove poll %d", this, poll->n_fds);
|
g_debug ("node %p: remove poll %d", this, poll->n_fds);
|
||||||
|
for (i = 0; i < priv->n_poll; i++) {
|
||||||
|
if (priv->poll[i].id == poll->id) {
|
||||||
|
priv->n_poll--;
|
||||||
|
for (; i < priv->n_poll; i++)
|
||||||
|
priv->poll[i] = priv->poll[i+1];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (priv->n_poll > 0) {
|
||||||
priv->rebuild_fds = true;
|
priv->rebuild_fds = true;
|
||||||
wakeup_thread (this);
|
wakeup_thread (this);
|
||||||
|
} else {
|
||||||
stop_thread (this);
|
stop_thread (this);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SPA_EVENT_TYPE_HAVE_OUTPUT:
|
case SPA_EVENT_TYPE_HAVE_OUTPUT:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue