mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	pulse-server: use async reply for set_default_sink/source
Because we set the default sink/source before calling the metadata, we don't send out updates about the new sink and this confuses pavucontrol. Instead, use the new async reply to reply once the new metadata has been configured and the defaults have been updated.
This commit is contained in:
		
							parent
							
								
									fdcbe67941
								
							
						
					
					
						commit
						a5922a9c0a
					
				
					 1 changed files with 1 additions and 8 deletions
				
			
		| 
						 | 
					@ -4897,13 +4897,6 @@ static int do_set_default(struct client *client, uint32_t command, uint32_t tag,
 | 
				
			||||||
	if (name != NULL && (o = find_device(client, SPA_ID_INVALID, name, sink)) == NULL)
 | 
						if (name != NULL && (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) {
 | 
						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,
 | 
				
			||||||
| 
						 | 
					@ -4918,7 +4911,7 @@ static int do_set_default(struct client *client, uint32_t command, uint32_t tag,
 | 
				
			||||||
	if (res < 0)
 | 
						if (res < 0)
 | 
				
			||||||
		return res;
 | 
							return res;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return reply_simple_ack(client, tag);
 | 
						return operation_new(client, tag);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static int do_suspend(struct client *client, uint32_t command, uint32_t tag, struct message *m)
 | 
					static int do_suspend(struct client *client, uint32_t command, uint32_t tag, struct message *m)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue