mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	jack: use the node activation position after connecting
Until we get assigned to a driver, use our own activation position to report samplerate and buffer size.
This commit is contained in:
		
							parent
							
								
									7768a87a0b
								
							
						
					
					
						commit
						2b507cbe79
					
				
					 1 changed files with 13 additions and 4 deletions
				
			
		| 
						 | 
				
			
			@ -1294,6 +1294,7 @@ static int client_node_transport(void *object,
 | 
			
		|||
					  true, on_rtsocket_condition, c);
 | 
			
		||||
 | 
			
		||||
	c->has_transport = true;
 | 
			
		||||
	c->position = &c->activation->position;
 | 
			
		||||
	pw_thread_loop_signal(c->context.loop, false);
 | 
			
		||||
 | 
			
		||||
	return 0;
 | 
			
		||||
| 
						 | 
				
			
			@ -3127,8 +3128,12 @@ jack_nframes_t jack_get_sample_rate (jack_client_t *client)
 | 
			
		|||
{
 | 
			
		||||
	struct client *c = (struct client *) client;
 | 
			
		||||
	spa_return_val_if_fail(c != NULL, 0);
 | 
			
		||||
	if (c->sample_rate == (uint32_t)-1)
 | 
			
		||||
		return c->rt.position ? c->rt.position->clock.rate.denom : 0;
 | 
			
		||||
	if (c->sample_rate == (uint32_t)-1) {
 | 
			
		||||
		if (c->rt.position)
 | 
			
		||||
			return c->rt.position->clock.rate.denom;
 | 
			
		||||
		if (c->position)
 | 
			
		||||
			return c->position->clock.rate.denom;
 | 
			
		||||
	}
 | 
			
		||||
	return c->sample_rate;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -3137,8 +3142,12 @@ jack_nframes_t jack_get_buffer_size (jack_client_t *client)
 | 
			
		|||
{
 | 
			
		||||
	struct client *c = (struct client *) client;
 | 
			
		||||
	spa_return_val_if_fail(c != NULL, 0);
 | 
			
		||||
	if (c->buffer_frames == (uint32_t)-1)
 | 
			
		||||
		return c->rt.position ? c->rt.position->clock.duration : 0;
 | 
			
		||||
	if (c->buffer_frames == (uint32_t)-1) {
 | 
			
		||||
		if (c->rt.position)
 | 
			
		||||
			return c->rt.position->clock.duration;
 | 
			
		||||
		if (c->position)
 | 
			
		||||
			return c->position->clock.duration;
 | 
			
		||||
	}
 | 
			
		||||
	return c->buffer_frames;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue