From 32bb7a5e6204d5de3b481241793f8c075f15f5ea Mon Sep 17 00:00:00 2001 From: falkTX Date: Mon, 30 Sep 2019 09:15:04 +0100 Subject: [PATCH] Allow loading of vst2 plugins without an uniqueID at the start Signed-off-by: falkTX --- source/discovery/carla-discovery.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/source/discovery/carla-discovery.cpp b/source/discovery/carla-discovery.cpp index 4dc7decc0..04a71172b 100644 --- a/source/discovery/carla-discovery.cpp +++ b/source/discovery/carla-discovery.cpp @@ -1023,9 +1023,7 @@ static void do_vst_check(lib_t& libHandle, const char* const filename, const boo if (effect->uniqueID == 0) { - DISCOVERY_OUT("error", "Plugin doesn't have an Unique ID"); - effect->dispatcher(effect, effClose, 0, 0, nullptr, 0.0f); - return; + DISCOVERY_OUT("warning", "Plugin doesn't have an Unique ID when first loaded"); } effect->dispatcher(effect, DECLARE_VST_DEPRECATED(effIdentify), 0, 0, nullptr, 0.0f); @@ -1040,6 +1038,14 @@ static void do_vst_check(lib_t& libHandle, const char* const filename, const boo effect->dispatcher(effect, effSetProgram, 0, 0, nullptr, 0.0f); const bool isShell = (effect->dispatcher(effect, effGetPlugCategory, 0, 0, nullptr, 0.0f) == kPlugCategShell); + + if (effect->uniqueID == 0 && !isShell) + { + DISCOVERY_OUT("error", "Plugin doesn't have an Unique ID after being open"); + effect->dispatcher(effect, effClose, 0, 0, nullptr, 0.0f); + return; + } + gVstCurrentUniqueId = effect->uniqueID; char strBuf[STR_MAX+1];