mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-23 19:20:56 +00:00
Be prepared if someone feels like breaking getDeviceName
This commit is contained in:
parent
d4f4b3c304
commit
dd44b2668c
@ -420,12 +420,12 @@ namespace MWSound
|
||||
std::basic_string_view<ALCchar> defaultName = getDeviceName(nullptr);
|
||||
if (mCurrentName != defaultName)
|
||||
{
|
||||
Log(Debug::Info) << "Default audio device changed";
|
||||
mCurrentName = defaultName;
|
||||
Log(Debug::Info) << "Default audio device changed to \"" << mCurrentName << "\"";
|
||||
ALCboolean reopened = alcReopenDeviceSOFT(
|
||||
mOutput.mDevice, defaultName.data(), mOutput.mContextAttributes.data());
|
||||
mOutput.mDevice, mCurrentName.data(), mOutput.mContextAttributes.data());
|
||||
if (reopened == AL_FALSE)
|
||||
Log(Debug::Warning) << "Failed to switch to new audio device";
|
||||
mCurrentName = defaultName;
|
||||
}
|
||||
}
|
||||
mCondVar.wait_for(lock, std::chrono::seconds(2));
|
||||
|
Loading…
x
Reference in New Issue
Block a user