mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	improve debug and error handling
This commit is contained in:
		
							parent
							
								
									6c7d2d0e1e
								
							
						
					
					
						commit
						d27674722a
					
				
					 6 changed files with 25 additions and 19 deletions
				
			
		| 
						 | 
				
			
			@ -545,13 +545,15 @@ static int port_set_format(struct spa_node *node,
 | 
			
		|||
		if (spa_format_audio_raw_parse(format, &info.info.raw) < 0)
 | 
			
		||||
			return -EINVAL;
 | 
			
		||||
 | 
			
		||||
		if (info.info.raw.format != SPA_AUDIO_FORMAT_F32P)
 | 
			
		||||
			return -EINVAL;
 | 
			
		||||
		if (info.info.raw.channels != 1)
 | 
			
		||||
			return -EINVAL;
 | 
			
		||||
 | 
			
		||||
		if (this->have_format) {
 | 
			
		||||
			if (memcmp(&info, &this->format, sizeof(struct spa_audio_info)))
 | 
			
		||||
			if (info.info.raw.rate != this->format.info.raw.rate)
 | 
			
		||||
				return -EINVAL;
 | 
			
		||||
		} else {
 | 
			
		||||
			if (info.info.raw.format != SPA_AUDIO_FORMAT_F32P)
 | 
			
		||||
				return -EINVAL;
 | 
			
		||||
 | 
			
		||||
			this->stride = sizeof(float);
 | 
			
		||||
			this->have_format = true;
 | 
			
		||||
			this->format = info;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue