mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	coreaudio: Catch devices with more channels than we support
This commit is contained in:
		
							parent
							
								
									cf503f9560
								
							
						
					
					
						commit
						3977a906e2
					
				
					 1 changed files with 10 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -415,6 +415,11 @@ static int ca_device_create_sink(pa_module *m, AudioBuffer *buf, int channel_idx
 | 
			
		|||
    AudioObjectPropertyAddress property_address;
 | 
			
		||||
    CFStringRef tmp_cfstr = NULL;
 | 
			
		||||
 | 
			
		||||
    if (buf->mNumberChannels > PA_CHANNELS_MAX) {
 | 
			
		||||
        pa_log("Skipping device with more channels than we support (%u)", (unsigned int) buf->mNumberChannels);
 | 
			
		||||
        return -1;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    ca_sink = pa_xnew0(coreaudio_sink, 1);
 | 
			
		||||
    ca_sink->map.channels = buf->mNumberChannels;
 | 
			
		||||
    ca_sink->ss.channels = buf->mNumberChannels;
 | 
			
		||||
| 
						 | 
				
			
			@ -543,6 +548,11 @@ static int ca_device_create_source(pa_module *m, AudioBuffer *buf, int channel_i
 | 
			
		|||
    AudioObjectPropertyAddress property_address;
 | 
			
		||||
    CFStringRef tmp_cfstr = NULL;
 | 
			
		||||
 | 
			
		||||
    if (buf->mNumberChannels > PA_CHANNELS_MAX) {
 | 
			
		||||
        pa_log("Skipping device with more channels than we support (%u)", (unsigned int) buf->mNumberChannels);
 | 
			
		||||
        return -1;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    ca_source = pa_xnew0(coreaudio_source, 1);
 | 
			
		||||
    ca_source->map.channels = buf->mNumberChannels;
 | 
			
		||||
    ca_source->ss.channels = buf->mNumberChannels;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue