mirror of
https://github.com/moonlight-stream/moonlight-ios.git
synced 2026-06-17 14:11:35 +00:00
Cap selected channel count at physical maximum
This commit is contained in:
@@ -632,8 +632,12 @@ static NSMutableSet* hostList;
|
|||||||
_streamConfig.multiController = streamSettings.multiController;
|
_streamConfig.multiController = streamSettings.multiController;
|
||||||
_streamConfig.gamepadMask = [ControllerSupport getConnectedGamepadMask:_streamConfig];
|
_streamConfig.gamepadMask = [ControllerSupport getConnectedGamepadMask:_streamConfig];
|
||||||
|
|
||||||
int numberOfChannels = [streamSettings.audioConfig intValue];
|
// Probe for supported channel configurations
|
||||||
Log(LOG_I, @"Number of audio channels %d", numberOfChannels);
|
int physicalOutputChannels = (int)[AVAudioSession sharedInstance].maximumOutputNumberOfChannels;
|
||||||
|
Log(LOG_I, @"Audio device supports %d channels", physicalOutputChannels);
|
||||||
|
|
||||||
|
int numberOfChannels = MIN([streamSettings.audioConfig intValue], physicalOutputChannels);
|
||||||
|
Log(LOG_I, @"Selected number of audio channels %d", numberOfChannels);
|
||||||
if (numberOfChannels >= 8) {
|
if (numberOfChannels >= 8) {
|
||||||
_streamConfig.audioConfiguration = AUDIO_CONFIGURATION_71_SURROUND;
|
_streamConfig.audioConfiguration = AUDIO_CONFIGURATION_71_SURROUND;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user