Browse Source

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

tags/2021-05-28
ed 6 years ago
parent
commit
8a66f1f3d3
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      modules/juce_audio_devices/audio_io/juce_AudioDeviceManager.cpp

+ 2
- 2
modules/juce_audio_devices/audio_io/juce_AudioDeviceManager.cpp 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)];
}
}


Loading…
Cancel
Save