From 3476617cffb857367846d7c169cb054e6411eb00 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 10 Dec 2018 15:09:04 +0100 Subject: [PATCH] node: only add node when active When moving a node from one graph to another, only add the node if it was actually added to the source graph. Because nodes are added when activated, it might be possible the node was not added yet. --- src/pipewire/node.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pipewire/node.c b/src/pipewire/node.c index c9704034f..50302428f 100644 --- a/src/pipewire/node.c +++ b/src/pipewire/node.c @@ -524,9 +524,10 @@ do_move_nodes(struct spa_loop *loop, pw_log_trace("node %p: root %p driver:%p->%p", this, &this->rt.root, &src->driver_graph, &dst->driver_graph); - if (this->rt.root.graph != NULL) + if (this->rt.root.graph != NULL) { spa_graph_node_remove(&this->rt.root); - spa_graph_node_add(&dst->driver_graph, &this->rt.root); + spa_graph_node_add(&dst->driver_graph, &this->rt.root); + } if (this->node && spa_node_set_io(this->node, SPA_IO_Position,