From 5c48d16548cce0e260e7dd84bfbf64743c93c5cb Mon Sep 17 00:00:00 2001 From: jules Date: Fri, 26 Dec 2014 13:41:01 +0000 Subject: [PATCH] Fix for an ASIO problem when opening an input-only device --- modules/juce_audio_devices/native/juce_win32_ASIO.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/juce_audio_devices/native/juce_win32_ASIO.cpp b/modules/juce_audio_devices/native/juce_win32_ASIO.cpp index b171bedd65..3e34294d97 100644 --- a/modules/juce_audio_devices/native/juce_win32_ASIO.cpp +++ b/modules/juce_audio_devices/native/juce_win32_ASIO.cpp @@ -300,7 +300,7 @@ private: //============================================================================== class ASIOAudioIODevice; -static ASIOAudioIODevice* volatile currentASIODev[3] = { 0 }; +static ASIOAudioIODevice* volatile currentASIODev[4] = { 0 }; extern HWND juce_messageWindowHandle; @@ -1503,15 +1503,16 @@ public: jassert (inputDeviceName == outputDeviceName || outputDeviceName.isEmpty() || inputDeviceName.isEmpty()); jassert (hasScanned); // need to call scanForDevices() before doing this - const int index = deviceNames.indexOf (outputDeviceName.isNotEmpty() ? outputDeviceName - : inputDeviceName); + const String deviceName (outputDeviceName.isNotEmpty() ? outputDeviceName + : inputDeviceName); + const int index = deviceNames.indexOf (deviceName); if (index >= 0) { const int freeSlot = findFreeSlot(); if (freeSlot >= 0) - return new ASIOAudioIODevice (this, outputDeviceName, + return new ASIOAudioIODevice (this, deviceName, classIds.getReference (index), freeSlot); }