From 0fb99d4421e217e2060fcff823d836aa98c9c4e5 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 23 Jun 2023 11:13:45 +0200 Subject: [PATCH] impl-port: clear port Format when no mixers Bring the state to CONFIGURE by actually setting the FORMAT to NULL when we remove the last mixer. Otherwise the buffers and formats are still on the port and we might try to use them while negotiating a new format later. Avoids some crashes. --- src/pipewire/impl-port.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pipewire/impl-port.c b/src/pipewire/impl-port.c index 1d1caaeda..daf9d0a36 100644 --- a/src/pipewire/impl-port.c +++ b/src/pipewire/impl-port.c @@ -345,7 +345,7 @@ int pw_impl_port_release_mix(struct pw_impl_port *port, struct pw_impl_port_mix SPA_IO_Buffers, NULL, sizeof(port->rt.io)); - pw_impl_port_update_state(port, PW_IMPL_PORT_STATE_CONFIGURE, 0, NULL); + pw_impl_port_set_param(port, SPA_PARAM_Format, 0, NULL); } return res; }