mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	pulse-server: do a roundtrip before replying to PLAY_SAMPLE
So that we can map the stream id to the sink_index. Fixes #2142
This commit is contained in:
		
							parent
							
								
									7ddcc91461
								
							
						
					
					
						commit
						1ca5bc6b94
					
				
					 1 changed files with 9 additions and 3 deletions
				
			
		| 
						 | 
					@ -2324,12 +2324,11 @@ static struct pw_manager_object *find_device(struct client *client,
 | 
				
			||||||
	return o;
 | 
						return o;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void sample_play_ready(void *data, uint32_t id)
 | 
					static void sample_play_ready_reply(void *data, struct client *client, uint32_t tag)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct pending_sample *ps = data;
 | 
						struct pending_sample *ps = data;
 | 
				
			||||||
	struct client *client = ps->client;
 | 
					 | 
				
			||||||
	struct message *reply;
 | 
						struct message *reply;
 | 
				
			||||||
	uint32_t index = id_to_index(client->manager, id);
 | 
						uint32_t index = id_to_index(client->manager, ps->play->id);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	pw_log_info("[%s] PLAY_SAMPLE tag:%u index:%u",
 | 
						pw_log_info("[%s] PLAY_SAMPLE tag:%u index:%u",
 | 
				
			||||||
			client->name, ps->tag, index);
 | 
								client->name, ps->tag, index);
 | 
				
			||||||
| 
						 | 
					@ -2343,6 +2342,13 @@ static void sample_play_ready(void *data, uint32_t id)
 | 
				
			||||||
	client_queue_message(client, reply);
 | 
						client_queue_message(client, reply);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					static void sample_play_ready(void *data, uint32_t id)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						struct pending_sample *ps = data;
 | 
				
			||||||
 | 
						struct client *client = ps->client;
 | 
				
			||||||
 | 
						operation_new_cb(client, ps->tag, sample_play_ready_reply, ps);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void on_sample_done(void *obj, void *data, int res, uint32_t id)
 | 
					static void on_sample_done(void *obj, void *data, int res, uint32_t id)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct pending_sample *ps = obj;
 | 
						struct pending_sample *ps = obj;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue