From 056895885686c468666442d3ace439cf6c4f34b0 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 20 Oct 2021 16:19:04 +0200 Subject: [PATCH] impl-link: keep on negotiatiating until fixed Format Send unfixed Format to nodes but don't proceed to the next state. When EnumFormat is emited, change the link state back to INIT to restart the negotiation. Fixes #1732 --- src/pipewire/impl-link.c | 4 ++-- src/pipewire/impl-port.c | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/pipewire/impl-link.c b/src/pipewire/impl-link.c index c7b57d88a..bcc43edfe 100644 --- a/src/pipewire/impl-link.c +++ b/src/pipewire/impl-link.c @@ -916,8 +916,6 @@ static void port_param_changed(struct pw_impl_link *this, uint32_t id, case SPA_PARAM_EnumFormat: target = PW_IMPL_PORT_STATE_CONFIGURE; break; - case SPA_PARAM_Latency: - return; default: return; } @@ -926,6 +924,8 @@ static void port_param_changed(struct pw_impl_link *this, uint32_t id, if (inport) pw_impl_port_update_state(inport, target, 0, NULL); + this->preparing = this->prepared = false; + link_update_state(this, PW_LINK_STATE_INIT, 0, NULL); pw_impl_link_prepare(this); } diff --git a/src/pipewire/impl-port.c b/src/pipewire/impl-port.c index af4cb9779..faddedd52 100644 --- a/src/pipewire/impl-port.c +++ b/src/pipewire/impl-port.c @@ -1419,6 +1419,10 @@ int pw_impl_port_set_param(struct pw_impl_port *port, uint32_t id, uint32_t flag if (param == NULL || res < 0) { pw_impl_port_update_state(port, PW_IMPL_PORT_STATE_CONFIGURE, 0, NULL); } + else if (spa_pod_is_fixated(param) <= 0) { + pw_impl_port_update_state(port, PW_IMPL_PORT_STATE_CONFIGURE, 0, NULL); + pw_impl_port_emit_param_changed(port, id); + } else if (!SPA_RESULT_IS_ASYNC(res)) { pw_impl_port_update_state(port, PW_IMPL_PORT_STATE_READY, 0, NULL); }