mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	pw-cli: allow '-' for port/node in create-link
Passing a '-' as the port or node for create-link will omit sending the property to create-link so we can check if the link factory handles missing properties too. See #1365
This commit is contained in:
		
							parent
							
								
									27b9f469b5
								
							
						
					
					
						commit
						2c5d89ff19
					
				
					 1 changed files with 8 additions and 4 deletions
				
			
		| 
						 | 
					@ -1387,10 +1387,14 @@ static bool do_create_link(struct data *data, const char *cmd, char *args, char
 | 
				
			||||||
	else
 | 
						else
 | 
				
			||||||
		props = pw_properties_new(NULL, NULL);
 | 
							props = pw_properties_new(NULL, NULL);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	pw_properties_set(props, PW_KEY_LINK_OUTPUT_NODE, a[0]);
 | 
						if (!spa_streq(a[0], "-"))
 | 
				
			||||||
	pw_properties_set(props, PW_KEY_LINK_OUTPUT_PORT, a[1]);
 | 
							pw_properties_set(props, PW_KEY_LINK_OUTPUT_NODE, a[0]);
 | 
				
			||||||
	pw_properties_set(props, PW_KEY_LINK_INPUT_NODE, a[2]);
 | 
						if (!spa_streq(a[1], "-"))
 | 
				
			||||||
	pw_properties_set(props, PW_KEY_LINK_INPUT_PORT, a[3]);
 | 
							pw_properties_set(props, PW_KEY_LINK_OUTPUT_PORT, a[1]);
 | 
				
			||||||
 | 
						if (!spa_streq(a[2], "-"))
 | 
				
			||||||
 | 
							pw_properties_set(props, PW_KEY_LINK_INPUT_NODE, a[2]);
 | 
				
			||||||
 | 
						if (!spa_streq(a[3], "-"))
 | 
				
			||||||
 | 
							pw_properties_set(props, PW_KEY_LINK_INPUT_PORT, a[3]);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	proxy = (struct pw_proxy*)pw_core_create_object(rd->core,
 | 
						proxy = (struct pw_proxy*)pw_core_create_object(rd->core,
 | 
				
			||||||
					  "link-factory",
 | 
										  "link-factory",
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue