mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-10-29 05:40:27 -04:00 
			
		
		
		
	jack: emit buffer_size during jack_activate()
JACK emits the bufsize callback from the processing thread while jack_activate() is called. Do the same with a blocking invoke. The GStreamer plugin relies on this and when it reives the bufsize callback later, it will error out. Fixes #4260
This commit is contained in:
		
							parent
							
								
									36617fc833
								
							
						
					
					
						commit
						ef40bb1d48
					
				
					 1 changed files with 16 additions and 1 deletions
				
			
		|  | @ -4720,6 +4720,17 @@ static int do_activate(struct client *c) | |||
| 	return res; | ||||
| } | ||||
| 
 | ||||
| static int | ||||
| do_emit_buffer_size(struct spa_loop *loop, | ||||
|                   bool async, uint32_t seq, const void *data, size_t size, void *user_data) | ||||
| { | ||||
| 	struct client *c = user_data; | ||||
| 	c->buffer_frames = c->rt.position->clock.duration; | ||||
| 	pw_log_debug("%p: emit buffersize %d", c, c->buffer_frames); | ||||
| 	c->bufsize_callback(c->buffer_frames, c->bufsize_arg); | ||||
| 	return 0; | ||||
| } | ||||
| 
 | ||||
| SPA_EXPORT | ||||
| int jack_activate (jack_client_t *client) | ||||
| { | ||||
|  | @ -4760,8 +4771,12 @@ done: | |||
| 	if (res < 0) { | ||||
| 		c->active = false; | ||||
| 		pw_data_loop_stop(c->loop); | ||||
| 	} else if (SPA_LIKELY(c->bufsize_callback != NULL)) { | ||||
| 		pw_thread_loop_unlock(c->context.loop); | ||||
| 		pw_data_loop_invoke(c->loop, | ||||
| 				do_emit_buffer_size, SPA_ID_INVALID, NULL, 0, true, c); | ||||
| 		pw_thread_loop_lock(c->context.loop); | ||||
| 	} | ||||
| 
 | ||||
| 	pw_log_debug("%p: activate result:%d", c, res); | ||||
| 	thaw_callbacks(c); | ||||
| 	pw_thread_loop_unlock(c->context.loop); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Wim Taymans
						Wim Taymans