mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	pulse-server: set our default sink/source immediately
In COMMAND_SET_DEFAULT_SINK/SOURCE, set our default source and sink immediately instead of waiting for the metadata update. This makes it possible to check for the new default sink immediately in other modules.
This commit is contained in:
		
							parent
							
								
									dbebbe2f33
								
							
						
					
					
						commit
						d9b80fda37
					
				
					 1 changed files with 10 additions and 2 deletions
				
			
		| 
						 | 
					@ -4847,9 +4847,17 @@ static int do_set_default(struct client *client, uint32_t command, uint32_t tag,
 | 
				
			||||||
	pw_log_info(NAME" %p: [%s] %s tag:%u name:%s", impl, client->name,
 | 
						pw_log_info(NAME" %p: [%s] %s tag:%u name:%s", impl, client->name,
 | 
				
			||||||
			commands[command].name, tag, name);
 | 
								commands[command].name, tag, name);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (name != NULL) {
 | 
						if (name != NULL && (o = find_device(client, SPA_ID_INVALID, name, sink)) == NULL)
 | 
				
			||||||
		if ((o = find_device(client, SPA_ID_INVALID, name, sink)) == NULL)
 | 
					 | 
				
			||||||
		return -ENOENT;
 | 
							return -ENOENT;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (sink) {
 | 
				
			||||||
 | 
							free(client->default_sink);
 | 
				
			||||||
 | 
							client->default_sink = name ? strdup(name) : NULL;
 | 
				
			||||||
 | 
						} else {
 | 
				
			||||||
 | 
							free(client->default_source);
 | 
				
			||||||
 | 
							client->default_source = name ? strdup(name) : NULL;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						if (name != NULL) {
 | 
				
			||||||
		res = pw_manager_set_metadata(manager, client->metadata_default,
 | 
							res = pw_manager_set_metadata(manager, client->metadata_default,
 | 
				
			||||||
				PW_ID_CORE,
 | 
									PW_ID_CORE,
 | 
				
			||||||
				sink ? METADATA_CONFIG_DEFAULT_SINK : METADATA_CONFIG_DEFAULT_SOURCE,
 | 
									sink ? METADATA_CONFIG_DEFAULT_SINK : METADATA_CONFIG_DEFAULT_SOURCE,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue