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.
This commit is contained in:
Wim Taymans 2018-12-10 15:09:04 +01:00
parent c42b108ac8
commit 3476617cff

View file

@ -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,