filter-chain: support single copy plugin

When input and output are linked with a copy function, don't disable the
node but add it to the valid graph inputs.
This commit is contained in:
Wim Taymans 2023-02-07 14:14:55 +01:00
parent 72242dc91f
commit 344be779b1

View file

@ -1938,6 +1938,8 @@ static int setup_graph(struct graph *graph, struct spa_json *inputs, struct spa_
pw_log_error("input port %s not found", v); pw_log_error("input port %s not found", v);
goto error; goto error;
} else { } else {
bool disabled = false;
desc = port->node->desc; desc = port->node->desc;
d = desc->desc; d = desc->desc;
if (i == 0 && port->external != SPA_ID_INVALID) { if (i == 0 && port->external != SPA_ID_INVALID) {
@ -1972,12 +1974,14 @@ static int setup_graph(struct graph *graph, struct spa_json *inputs, struct spa_
gp->hndl = &peer->node->hndl[i]; gp->hndl = &peer->node->hndl[i];
gp->port = peer->p; gp->port = peer->p;
gp->next = true; gp->next = true;
disabled = true;
} }
if (gp != NULL) if (gp != NULL)
gp->next = false; gp->next = false;
} }
port->node->disabled = true; port->node->disabled = disabled;
} else { }
if (!disabled) {
pw_log_info("input port %s[%d]:%s", pw_log_info("input port %s[%d]:%s",
port->node->name, i, d->ports[port->p].name); port->node->name, i, d->ports[port->p].name);
port->external = graph->n_input; port->external = graph->n_input;