From e8464cf1b3eae2a1239a45072464f5068fb16113 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 23 Oct 2019 16:45:22 +0200 Subject: [PATCH] port: fix client-side buffers again Clear the ALLOC flag for the mixer use_buffers only when the node did the allocation already. Fixes #193 --- src/pipewire/port.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/pipewire/port.c b/src/pipewire/port.c index 8568bfeff..b1dc6e473 100644 --- a/src/pipewire/port.c +++ b/src/pipewire/port.c @@ -1246,9 +1246,9 @@ int pw_port_use_buffers(struct pw_port *port, struct pw_port_mix *mix, uint32_t { int res = 0, res2; - pw_log_debug(NAME" %p: %d:%d.%d: %d buffers state:%d n_mix:%d", port, + pw_log_debug(NAME" %p: %d:%d.%d: %d buffers flags:%d state:%d n_mix:%d", port, port->direction, port->port_id, mix->id, - n_buffers, port->state, port->n_mix); + n_buffers, flags, port->state, port->n_mix); if (n_buffers == 0 && port->state <= PW_PORT_STATE_READY) return 0; @@ -1274,11 +1274,12 @@ int pw_port_use_buffers(struct pw_port *port, struct pw_port_mix *mix, uint32_t } else if (n_buffers > 0 && !SPA_RESULT_IS_ASYNC(res)) { pw_port_update_state(port, PW_PORT_STATE_PAUSED, NULL); } - } /* then use the buffers on the mixer */ - flags &= ~SPA_NODE_BUFFERS_FLAG_ALLOC; + if (!SPA_FLAG_IS_SET(port->mix_flags, PW_PORT_MIX_FLAG_MIX_ONLY)) + flags &= ~SPA_NODE_BUFFERS_FLAG_ALLOC; + res2 = spa_node_port_use_buffers(port->mix, mix->port.direction, mix->port.port_id, flags, buffers, n_buffers);