mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	examples: handle NULL io areas
This commit is contained in:
		
							parent
							
								
									fdfce79edb
								
							
						
					
					
						commit
						f2f94c4f72
					
				
					 2 changed files with 8 additions and 4 deletions
				
			
		| 
						 | 
				
			
			@ -247,8 +247,10 @@ static int impl_port_set_io(struct spa_node *node,
 | 
			
		|||
	if (id == d->t->io.Buffers)
 | 
			
		||||
		d->io = data;
 | 
			
		||||
	else if (id == d->type.io_prop_param) {
 | 
			
		||||
		if (data && size >= sizeof(struct spa_pod_double))
 | 
			
		||||
			d->ctrl_param = data;
 | 
			
		||||
		*d->ctrl_param = SPA_POD_DOUBLE_INIT(DEFAULT_PARAM);
 | 
			
		||||
		else
 | 
			
		||||
			d->ctrl_param = NULL;
 | 
			
		||||
	}
 | 
			
		||||
	else
 | 
			
		||||
		return -ENOENT;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -162,8 +162,10 @@ static int impl_port_set_io(struct spa_node *node, enum spa_direction direction,
 | 
			
		|||
	if (id == d->t->io.Buffers)
 | 
			
		||||
		d->io = data;
 | 
			
		||||
	else if (id == d->type.io_prop_volume) {
 | 
			
		||||
		if (data && size >= sizeof(struct spa_pod_double))
 | 
			
		||||
			d->ctrl_volume = data;
 | 
			
		||||
		*d->ctrl_volume = SPA_POD_DOUBLE_INIT(1.0);
 | 
			
		||||
		else
 | 
			
		||||
			d->ctrl_volume = NULL;
 | 
			
		||||
	}
 | 
			
		||||
	else
 | 
			
		||||
		return -ENOENT;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue