mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-06-18 06:30:55 +00:00
Gracefully fall back to stereo audio if 5.1 doesn't work
This commit is contained in:
@@ -512,8 +512,20 @@ bool Session::validateLaunch()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test that audio hardware is functional
|
// Test if audio works at the specified audio configuration
|
||||||
m_AudioDisabled = !testAudio(m_StreamConfig.audioConfiguration);
|
bool audioTestPassed = testAudio(m_StreamConfig.audioConfiguration);
|
||||||
|
|
||||||
|
// Gracefully degrade to stereo if 5.1 doesn't work
|
||||||
|
if (!audioTestPassed && m_StreamConfig.audioConfiguration == AUDIO_CONFIGURATION_51_SURROUND) {
|
||||||
|
audioTestPassed = testAudio(AUDIO_CONFIGURATION_STEREO);
|
||||||
|
if (audioTestPassed) {
|
||||||
|
m_StreamConfig.audioConfiguration = AUDIO_CONFIGURATION_STEREO;
|
||||||
|
emitLaunchWarning("5.1 surround sound is not supported by the current audio device.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// If nothing worked, warn the user that audio will not work
|
||||||
|
m_AudioDisabled = !audioTestPassed;
|
||||||
if (m_AudioDisabled) {
|
if (m_AudioDisabled) {
|
||||||
emitLaunchWarning("Failed to open audio device. Audio will be unavailable during this session.");
|
emitLaunchWarning("Failed to open audio device. Audio will be unavailable during this session.");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user