1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Ensure that audio device is always stopped before modifying in AudioDeviceManager::setAudioDeviceSetup()

This commit is contained in:
ed 2020-07-21 15:51:15 +01:00
parent 450ac8ade5
commit 21e4522891

View file

@ -544,6 +544,8 @@ String AudioDeviceManager::setAudioDeviceSetup (const AudioDeviceSetup& newSetup
else if (currentAudioDevice != nullptr)
return {};
stopDevice();
if (getCurrentDeviceTypeObject() == nullptr
|| (newSetup.inputDeviceName.isEmpty() && newSetup.outputDeviceName.isEmpty()))
{
@ -555,8 +557,6 @@ String AudioDeviceManager::setAudioDeviceSetup (const AudioDeviceSetup& newSetup
return {};
}
stopDevice();
String error;
if (currentSetup.inputDeviceName != newSetup.inputDeviceName