mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	node: add master priority
Change node.priority to priority.session to indicate that this is the priority that the session manager uses to select the node. Add another priority.master that the core uses to select a master driver. Keep the driver nodes sorted by master priority. Let jack always prefer to connect to the master driver nodes.
This commit is contained in:
		
							parent
							
								
									fa25900682
								
							
						
					
					
						commit
						eb1d675cb0
					
				
					 6 changed files with 33 additions and 9 deletions
				
			
		| 
						 | 
				
			
			@ -144,8 +144,9 @@ static struct alsa_node *alsa_create_node(struct alsa_object *obj, uint32_t id,
 | 
			
		|||
	priority -= atol(dev) * 16;
 | 
			
		||||
	priority -= atol(subdev);
 | 
			
		||||
 | 
			
		||||
	if (pw_properties_get(node->props, PW_KEY_NODE_PRIORITY) == NULL) {
 | 
			
		||||
		pw_properties_setf(node->props, PW_KEY_NODE_PRIORITY, "%d", priority);
 | 
			
		||||
	if (pw_properties_get(node->props, PW_KEY_PRIORITY_MASTER) == NULL) {
 | 
			
		||||
		pw_properties_setf(node->props, PW_KEY_PRIORITY_MASTER, "%d", priority);
 | 
			
		||||
		pw_properties_setf(node->props, PW_KEY_PRIORITY_SESSION, "%d", priority);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (pw_properties_get(node->props, SPA_KEY_NODE_NAME) == NULL) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -509,7 +509,7 @@ handle_node(struct impl *impl, uint32_t id,
 | 
			
		|||
		else
 | 
			
		||||
			sess->plugged = SPA_TIMESPEC_TO_NSEC(&impl->now);
 | 
			
		||||
 | 
			
		||||
		if ((str = spa_dict_lookup(props, PW_KEY_NODE_PRIORITY)) != NULL)
 | 
			
		||||
		if ((str = spa_dict_lookup(props, PW_KEY_PRIORITY_SESSION)) != NULL)
 | 
			
		||||
			sess->priority = pw_properties_parse_int(str);
 | 
			
		||||
		else
 | 
			
		||||
			sess->priority = 0;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue