filter-chain: handle port names with :

When a port name contains a ':' we will try to split it and use the part
before the colon as the node name, which will then fail.

If we can't find a node name after splitting, try again by assuming the
colon is part of the port name.

Fixes control port names such as "Ratio (1:n)" in #2685
This commit is contained in:
Wim Taymans 2022-09-12 09:48:38 +02:00
parent fcff48f1f1
commit c00e0e3467

View file

@ -682,11 +682,21 @@ static struct port *find_port(struct node *node, const char *name, int descripto
str = strdupa(name);
col = strchr(str, ':');
if (col != NULL) {
struct node *find;
node_name = str;
port_name = col + 1;
*col = '\0';
node = find_node(node->graph, node_name);
} else {
find = find_node(node->graph, node_name);
if (find == NULL) {
/* it's possible that the : is part of the port name,
* try again without splitting things up. */
*col = ':';
col = NULL;
} else {
node = find;
}
}
if (col == NULL) {
node_name = node->name;
port_name = str;
}