Make failed audio device query non fatal

Querring the audio device name may fail. The name is only used for the
sake of logging it for debugging. Avoid querry failure to be fatal and
insted just log the issue.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This commit is contained in:
Ralph Sennhauser
2024-11-20 20:19:36 +01:00
parent bb1910ff4c
commit 49507c04e0
+14 -6
View File
@@ -838,15 +838,23 @@ void CSoundManager::RunHardwareDetection()
else
devices = alcGetString(nullptr, ALC_DEVICE_SPECIFIER);
}
WARN_IF_FALSE(devices);
m_SoundCardNames.clear();
do
if (devices)
{
m_SoundCardNames += devices;
devices += strlen(devices) + 1;
m_SoundCardNames += "; ";
} while (*devices);
do
{
m_SoundCardNames += devices;
devices += strlen(devices) + 1;
m_SoundCardNames += "; ";
} while (*devices);
}
else
{
const char* failMsg = "Failed to query audio device names";
LOGERROR(failMsg);
m_SoundCardNames = failMsg;
}
// Driver version
const ALCchar* al_version = alGetString(AL_VERSION);