diff options
author | Wim Taymans <wtaymans@redhat.com> | 2019-07-17 15:31:50 +0200 |
---|---|---|
committer | Wim Taymans <wtaymans@redhat.com> | 2019-07-17 15:31:50 +0200 |
commit | 1612ed793ef43601f68c5553d6bced400370f5bd (patch) | |
tree | fa2d069f587c0aec88973162f0da460972e0a5d4 | |
parent | af1b012a70c4225747fd67a009dd1bbe771880a3 (diff) |
core: handle slave_list in set_driver only
When destroying a node, move all slaved nodes to their own driver.
-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) |