mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	audiomixer: fix EnumFormat
When a format is set on one of the ports, only return that format from EnumFormat.
This commit is contained in:
		
							parent
							
								
									0eb44b340a
								
							
						
					
					
						commit
						865f671195
					
				
					 1 changed files with 21 additions and 11 deletions
				
			
		| 
						 | 
				
			
			@ -370,6 +370,15 @@ static int port_enum_formats(struct spa_node *node,
 | 
			
		|||
 | 
			
		||||
	switch (*index) {
 | 
			
		||||
	case 0:
 | 
			
		||||
		if (this->have_format) {
 | 
			
		||||
			*param = spa_pod_builder_object(builder,
 | 
			
		||||
				t->param.idEnumFormat, t->format,
 | 
			
		||||
				"I", t->media_type.audio,
 | 
			
		||||
				"I", t->media_subtype.raw,
 | 
			
		||||
				":", t->format_audio.format,   "I", this->format.info.raw.format,
 | 
			
		||||
				":", t->format_audio.rate,     "i", this->format.info.raw.rate,
 | 
			
		||||
				":", t->format_audio.channels, "i", this->format.info.raw.channels);
 | 
			
		||||
		} else {
 | 
			
		||||
			*param = spa_pod_builder_object(builder,
 | 
			
		||||
				t->param.idEnumFormat, t->format,
 | 
			
		||||
				"I", t->media_type.audio,
 | 
			
		||||
| 
						 | 
				
			
			@ -381,6 +390,7 @@ static int port_enum_formats(struct spa_node *node,
 | 
			
		|||
									2, 1, INT32_MAX,
 | 
			
		||||
				":", t->format_audio.channels, "iru", 2,
 | 
			
		||||
									2, 1, INT32_MAX);
 | 
			
		||||
		}
 | 
			
		||||
		break;
 | 
			
		||||
	default:
 | 
			
		||||
		return 0;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue