mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	jack: fix mixing..
This commit is contained in:
		
							parent
							
								
									274d616fa6
								
							
						
					
					
						commit
						e196e56287
					
				
					 1 changed files with 11 additions and 3 deletions
				
			
		| 
						 | 
					@ -2761,8 +2761,8 @@ static void *mix_audio(struct client *c, struct port *p, jack_nframes_t frames)
 | 
				
			||||||
		if (layer++ == 0)
 | 
							if (layer++ == 0)
 | 
				
			||||||
			ptr = b->datas[0].data;
 | 
								ptr = b->datas[0].data;
 | 
				
			||||||
		else  {
 | 
							else  {
 | 
				
			||||||
 | 
								mix2(p->emptyptr, ptr, b->datas[0].data, frames);
 | 
				
			||||||
			ptr = p->emptyptr;
 | 
								ptr = p->emptyptr;
 | 
				
			||||||
			mix2(ptr, ptr, b->datas[0].data, frames);
 | 
					 | 
				
			||||||
			p->zeroed = false;
 | 
								p->zeroed = false;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					@ -3748,18 +3748,24 @@ int  jack_set_timebase_callback (jack_client_t *client,
 | 
				
			||||||
	int res;
 | 
						int res;
 | 
				
			||||||
	struct client *c = (struct client *) client;
 | 
						struct client *c = (struct client *) client;
 | 
				
			||||||
	struct pw_node_activation *a = c->driver_activation;
 | 
						struct pw_node_activation *a = c->driver_activation;
 | 
				
			||||||
 | 
						uint32_t owner;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						pw_log_debug(NAME" %p: activation %p", c, a);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (a == NULL)
 | 
						if (a == NULL)
 | 
				
			||||||
		return -EIO;
 | 
							return -EIO;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* was ok */
 | 
						/* was ok */
 | 
				
			||||||
	if (ATOMIC_LOAD(a->segment_owner[0]) == c->node_id)
 | 
						owner = ATOMIC_LOAD(a->segment_owner[0]);
 | 
				
			||||||
 | 
						if (owner == c->node_id)
 | 
				
			||||||
		return 0;
 | 
							return 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* try to become master */
 | 
						/* try to become master */
 | 
				
			||||||
	if (conditional) {
 | 
						if (conditional) {
 | 
				
			||||||
		if (!ATOMIC_CAS(a->segment_owner[0], 0, c->node_id))
 | 
							if (!ATOMIC_CAS(a->segment_owner[0], 0, c->node_id)) {
 | 
				
			||||||
 | 
								pw_log_debug(NAME" %p: owner:%u id:%u", c, owner, c->node_id);
 | 
				
			||||||
			return -EBUSY;
 | 
								return -EBUSY;
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
	} else {
 | 
						} else {
 | 
				
			||||||
		ATOMIC_STORE(a->segment_owner[0], c->node_id);
 | 
							ATOMIC_STORE(a->segment_owner[0], c->node_id);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					@ -3767,6 +3773,8 @@ int  jack_set_timebase_callback (jack_client_t *client,
 | 
				
			||||||
	c->timebase_callback = timebase_callback;
 | 
						c->timebase_callback = timebase_callback;
 | 
				
			||||||
	c->timebase_arg = arg;
 | 
						c->timebase_arg = arg;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						pw_log_debug(NAME" %p: timebase set id:%u", c, c->node_id);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if ((res = do_activate(c)) < 0)
 | 
						if ((res = do_activate(c)) < 0)
 | 
				
			||||||
		return res;
 | 
							return res;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue