Allow audio to recover if no audio devices were present during stream start

This commit is contained in:
Cameron Gutman
2024-05-04 21:13:00 -05:00
parent 93ed985043
commit 6d220a9062
3 changed files with 64 additions and 51 deletions

View File

@@ -548,7 +548,6 @@ Session::Session(NvComputer* computer, NvApp& app, StreamingPreferences *prefere
m_Window(nullptr),
m_VideoDecoder(nullptr),
m_DecoderLock(0),
m_AudioDisabled(false),
m_AudioMuted(false),
m_QtWindow(nullptr),
m_UnexpectedTermination(true), // Failure prior to streaming is unexpected
@@ -993,8 +992,7 @@ bool Session::validateLaunch(SDL_Window* testWindow)
}
// If nothing worked, warn the user that audio will not work
m_AudioDisabled = !audioTestPassed;
if (m_AudioDisabled) {
if (!audioTestPassed) {
emitLaunchWarning(tr("Failed to open audio device. Audio will be unavailable during this session."));
}
@@ -1467,8 +1465,7 @@ bool Session::startConnectionAsync()
}
int err = LiStartConnection(&hostInfo, &m_StreamConfig, &k_ConnCallbacks,
&m_VideoCallbacks,
m_AudioDisabled ? nullptr : &m_AudioCallbacks,
&m_VideoCallbacks, &m_AudioCallbacks,
NULL, 0, NULL, 0);
if (err != 0) {
// We already displayed an error dialog in the stage failure