From c00e0e3467c4295d9bf9047da153a01b1deaf189 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 12 Sep 2022 09:48:38 +0200 Subject: [PATCH] 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 --- src/modules/module-filter-chain.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/modules/module-filter-chain.c b/src/modules/module-filter-chain.c index 5d86f92fb..bacedf6ef 100644 --- a/src/modules/module-filter-chain.c +++ b/src/modules/module-filter-chain.c @@ -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; }