From 6ad0eb533d57985980911ef055697f124b8dd29f Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 24 Aug 2023 09:42:41 +0200 Subject: [PATCH] Revert "impl-node: improve suspend" This reverts commit 3c47fa894b2111640795d1d4640b9e324f5ba0dc. suspend_node is called from other places where the node might not be IDLE. Fixes #3378 --- src/pipewire/impl-node.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/pipewire/impl-node.c b/src/pipewire/impl-node.c index 4fc29dbe7..ca431c389 100644 --- a/src/pipewire/impl-node.c +++ b/src/pipewire/impl-node.c @@ -434,19 +434,15 @@ static void node_update_state(struct pw_impl_node *node, enum pw_node_state stat static int suspend_node(struct pw_impl_node *this) { - struct impl *impl = SPA_CONTAINER_OF(this, struct impl, this); int res = 0; struct pw_impl_port *p; - bool active = this->active; pw_log_debug("%p: suspend node state:%s", this, pw_node_state_as_string(this->info.state)); - if (this->info.state != PW_NODE_STATE_ERROR && - impl->pending_state != PW_NODE_STATE_IDLE) + if (this->info.state > 0 && this->info.state <= PW_NODE_STATE_SUSPENDED) return 0; - this->active = false; node_deactivate(this); spa_list_for_each(p, &this->input_ports, link) { @@ -477,7 +473,6 @@ static int suspend_node(struct pw_impl_node *this) pw_log_warn("%p: suspend node error %s", this, spa_strerror(res)); node_update_state(this, PW_NODE_STATE_SUSPENDED, 0, NULL); - this->active = active; return res; }