From 4668b723123e1965538c38c2a7b4ddd573f6170b Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 23 Mar 2021 10:17:01 +0100 Subject: [PATCH] impl-node: first start the node, then make it schedulable We first need to issue the start command for driver nodes and then we can add the node to be scheduled. Else we might end up with nodes that receive the _process callback without the Start command being called first and we can crash. See #904 --- src/pipewire/impl-node.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pipewire/impl-node.c b/src/pipewire/impl-node.c index 0afcab53e..75a7d2a79 100644 --- a/src/pipewire/impl-node.c +++ b/src/pipewire/impl-node.c @@ -338,10 +338,11 @@ static void node_update_state(struct pw_impl_node *node, enum pw_node_state stat switch (state) { case PW_NODE_STATE_RUNNING: - pw_loop_invoke(node->data_loop, do_node_add, 1, NULL, 0, true, node); if (node->driving && node->driver) spa_node_send_command(node->node, &SPA_NODE_COMMAND_INIT(SPA_NODE_COMMAND_Start)); + + pw_loop_invoke(node->data_loop, do_node_add, 1, NULL, 0, true, node); break; default: break;