mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	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:
		
							parent
							
								
									fcff48f1f1
								
							
						
					
					
						commit
						c00e0e3467
					
				
					 1 changed files with 12 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -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;
 | 
			
		||||
	}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue