From 69e6db5216e73f55fee641f939a4fdff8c968447 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 23 Sep 2022 16:51:11 +0200 Subject: [PATCH] impl-node: only pause pause_on_idle nodes When we are starting a node and need to cancel it, only set the node to the paused state when pause_on_idle is set. Use the pause_node function to make sure everything is in the paused state. Otherwise we would send a Pause command to the node but because it was still added to the graph we would continue to call the process function on it. Fixes #2701 --- src/pipewire/impl-node.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pipewire/impl-node.c b/src/pipewire/impl-node.c index 3151b7156..54ccd6bf4 100644 --- a/src/pipewire/impl-node.c +++ b/src/pipewire/impl-node.c @@ -2222,8 +2222,8 @@ int pw_impl_node_set_state(struct pw_impl_node *node, enum pw_node_state state) state < PW_NODE_STATE_RUNNING && impl->pending_play) { impl->pending_play = false; - spa_node_send_command(node->node, - &SPA_NODE_COMMAND_INIT(SPA_NODE_COMMAND_Pause)); + if (impl->pause_on_idle) + pause_node(node); } pw_work_queue_cancel(impl->work, node, impl->pending_id); node->info.state = impl->pending_state;