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

Don't use default input/output device names when setting up an AudioDeviceManager if no channels have been requested

This commit is contained in:
ed 2019-03-01 12:44:47 +00:00
parent 8de98f5a82
commit 8a66f1f3d3

View file

@ -336,10 +336,10 @@ void AudioDeviceManager::insertDefaultDeviceNames (AudioDeviceSetup& setup) cons
{
if (auto* type = getCurrentDeviceTypeObject())
{
if (setup.outputDeviceName.isEmpty())
if (numOutputChansNeeded > 0 && setup.outputDeviceName.isEmpty())
setup.outputDeviceName = type->getDeviceNames (false) [type->getDefaultDeviceIndex (false)];
if (setup.inputDeviceName.isEmpty())
if (numInputChansNeeded > 0 && setup.inputDeviceName.isEmpty())
setup.inputDeviceName = type->getDeviceNames (true) [type->getDefaultDeviceIndex (true)];
}
}