From 4161fa3071767c2c888fc54fc999c6bfa987bf27 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 2 Oct 2025 16:13:32 +0200 Subject: [PATCH] impl-port: also honour CAN_ALLOC flag between mixer/node When we have a mixer node and we need to negotiate buffers between the mixer and the node, take the CAN_ALLOC flag into account. This is for input ports, which can have a mixer. If you make a filter with a CAN_ALLOC input port, it will now not already contain buffer data. See #4918 --- src/pipewire/impl-port.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/pipewire/impl-port.c b/src/pipewire/impl-port.c index 69725c4c3..a17d2490f 100644 --- a/src/pipewire/impl-port.c +++ b/src/pipewire/impl-port.c @@ -1960,6 +1960,10 @@ static int negotiate_mixer_buffers(struct pw_impl_port *port, uint32_t flags, alloc_flags |= PW_BUFFERS_FLAG_DYNAMIC; if (SPA_FLAG_IS_SET(node->spa_flags, SPA_NODE_FLAG_ASYNC)) alloc_flags |= PW_BUFFERS_FLAG_ASYNC; + if (SPA_FLAG_IS_SET(port->spa_flags, SPA_PORT_FLAG_CAN_ALLOC_BUFFERS)) { + alloc_flags |= PW_BUFFERS_FLAG_NO_MEM; + flags |= SPA_NODE_BUFFERS_FLAG_ALLOC; + } pw_log_debug("%p: %d.%d negotiate %d buffers on node: %p flags:%08x", port, port->direction, port->port_id, n_buffers, node->node,