mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	pulse-server: pass format to the null-sink
The effect is that the null-sink will report the given format in the Sample Specification, which is what some applications might expect when they pass a format parameter.
This commit is contained in:
		
							parent
							
								
									a9756def46
								
							
						
					
					
						commit
						c74efea51e
					
				
					 1 changed files with 9 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -163,6 +163,15 @@ static int module_null_sink_prepare(struct module * const module)
 | 
			
		|||
	if (module_args_to_audioinfo(module->impl, props, &info) < 0)
 | 
			
		||||
		return -EINVAL;
 | 
			
		||||
 | 
			
		||||
	info.format = module->impl->defs.sample_spec.format;
 | 
			
		||||
	if ((str = pw_properties_get(props, "format")) != NULL) {
 | 
			
		||||
		info.format = format_paname2id(str, strlen(str));
 | 
			
		||||
		pw_properties_set(props, "format", NULL);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (info.format)
 | 
			
		||||
		pw_properties_setf(props, SPA_KEY_AUDIO_FORMAT, "%s",
 | 
			
		||||
					format_id2name(info.format));
 | 
			
		||||
	if (info.rate)
 | 
			
		||||
		pw_properties_setf(props, SPA_KEY_AUDIO_RATE, "%u", info.rate);
 | 
			
		||||
	if (info.channels) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue