diff options
-rw-r--r-- | src/pipewire/core.c | 2 | ||||
-rw-r--r-- | src/pipewire/node.c | 8 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/pipewire/core.c b/src/pipewire/core.c index f6433a62..8530451d 100644 --- a/src/pipewire/core.c +++ b/src/pipewire/core.c @@ -1058,8 +1058,6 @@ static int collect_nodes(struct pw_node *driver) spa_list_consume(n, &queue, sort_link) { spa_list_remove(&n->sort_link); - spa_list_append(&driver->slave_list, &n->slave_link); - pw_node_set_driver(n, driver); if (n->quantum_size > 0 && n->quantum_size < quantum) diff --git a/src/pipewire/node.c b/src/pipewire/node.c index 341a204a..b113a4ee 100644 --- a/src/pipewire/node.c +++ b/src/pipewire/node.c @@ -620,7 +620,10 @@ int pw_node_set_driver(struct pw_node *node, struct pw_node *driver) node->master = node->driver && driver == node; pw_log_info("node %p: driver %p master:%u", node, driver, node->master); + spa_list_remove(&node->slave_link); node->driver_node = driver; + spa_list_append(&driver->slave_list, &node->slave_link); + pw_node_emit_driver_changed(node, old, driver); if ((res = spa_node_set_io(node->node, @@ -1218,6 +1221,11 @@ void pw_node_destroy(struct pw_node *node) /* remove ourself as a slave from the driver node */ spa_list_remove(&node->slave_link); + spa_list_consume(slave, &node->slave_list, slave_link) { + pw_log_debug("node %p: reslave %p", impl, slave); + pw_node_set_driver(slave, NULL); + } + if (node->registered) { spa_list_remove(&node->link); if (node->driver) |