From c99311e822c5ad61508b5d3fa88b03d145611567 Mon Sep 17 00:00:00 2001 From: Martin Geier Date: Wed, 27 Aug 2025 09:44:54 +0200 Subject: [PATCH] filter-graph: clear external field in unsetup_graph Without this change the playback with different number of channels fails with `input port %s[%d]:%s already used as input %d, use mixer` on the first port. Signed-off-by: Martin Geier Fixes #4866 --- spa/plugins/filter-graph/filter-graph.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/spa/plugins/filter-graph/filter-graph.c b/spa/plugins/filter-graph/filter-graph.c index 718bc542d..36d0c1ec1 100644 --- a/spa/plugins/filter-graph/filter-graph.c +++ b/spa/plugins/filter-graph/filter-graph.c @@ -1744,6 +1744,9 @@ error: static void unsetup_graph(struct graph *graph) { + struct node *node; + uint32_t i; + free(graph->input); graph->input = NULL; free(graph->output); @@ -1751,7 +1754,19 @@ static void unsetup_graph(struct graph *graph) free(graph->hndl); graph->hndl = NULL; + spa_list_for_each(node, &graph->node_list, link) { + struct descriptor *desc = node->desc; + for (i = 0; i < desc->n_input; i++) { + struct port *port = &node->input_port[i]; + port->external = SPA_ID_INVALID; + } + for (i = 0; i < desc->n_output; i++) { + struct port *port = &node->output_port[i]; + port->external = SPA_ID_INVALID; + } + } } + static int setup_graph(struct graph *graph) { struct impl *impl = graph->impl;