mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-04-14 19:56:25 +00:00
Allow streaming with no audio device. Fixes #52
This commit is contained in:
@@ -275,7 +275,8 @@ Session::Session(NvComputer* computer, NvApp& app)
|
||||
m_Window(nullptr),
|
||||
m_VideoDecoder(nullptr),
|
||||
m_DecoderLock(0),
|
||||
m_NeedsIdr(false)
|
||||
m_NeedsIdr(false),
|
||||
m_AudioDisabled(false)
|
||||
{
|
||||
qDebug() << "Server GPU:" << m_Computer->gpuModel;
|
||||
|
||||
@@ -472,6 +473,12 @@ bool Session::validateLaunch()
|
||||
}
|
||||
}
|
||||
|
||||
// Test that audio hardware is functional
|
||||
m_AudioDisabled = !testAudio(m_StreamConfig.audioConfiguration);
|
||||
if (m_AudioDisabled) {
|
||||
emitLaunchWarning("Failed to open audio device. Audio will be unavailable during this session.");
|
||||
}
|
||||
|
||||
if (m_Preferences.videoDecoderSelection == StreamingPreferences::VDS_FORCE_HARDWARE &&
|
||||
!isHardwareDecodeAvailable(m_Preferences.videoDecoderSelection,
|
||||
m_StreamConfig.supportsHevc ? VIDEO_FORMAT_H265 : VIDEO_FORMAT_H264,
|
||||
@@ -688,7 +695,8 @@ void Session::exec()
|
||||
}
|
||||
|
||||
int err = LiStartConnection(&hostInfo, &m_StreamConfig, &k_ConnCallbacks,
|
||||
&m_VideoCallbacks, &k_AudioCallbacks,
|
||||
&m_VideoCallbacks,
|
||||
m_AudioDisabled ? nullptr : &k_AudioCallbacks,
|
||||
NULL, 0, NULL, 0);
|
||||
if (err != 0) {
|
||||
// We already displayed an error dialog in the stage failure
|
||||
|
||||
Reference in New Issue
Block a user