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 <martin.geier@streamunlimited.com>

Fixes #4866
This commit is contained in:
Martin Geier 2025-08-27 09:44:54 +02:00 committed by Arun Raghavan
parent 37be6f8b7b
commit 9c310cf54c

View file

@ -1640,6 +1640,9 @@ static struct node *find_next_node(struct graph *graph)
static void unsetup_graph(struct graph *graph)
{
struct node *node;
uint32_t i;
free(graph->input);
graph->input = NULL;
free(graph->output);
@ -1647,7 +1650,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;