From 4e8129972982dcdeefb164d33298eb286d67b627 Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Tue, 7 Jul 2009 00:18:06 +0200 Subject: [PATCH] RemoteVstPlugin: workaround for early host callbacks by some plugins Some plugins call host callback from within their main function, causing RemoteVstPlugin::m_plugin not to be set yet. Therefore explicitely set RemoteVstPlugin::m_plugin if it's NULL. Makes plugins by Wallander Instruments (and possibly others as well) work. Signed-off-by: Tobias Doerffel (cherry picked from commit 38f7552ce4fbcb8503a885299dad23adb1233a4e) --- plugins/vst_base/remote_vst_plugin.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugins/vst_base/remote_vst_plugin.cpp b/plugins/vst_base/remote_vst_plugin.cpp index 50f05a225..a638ed692 100644 --- a/plugins/vst_base/remote_vst_plugin.cpp +++ b/plugins/vst_base/remote_vst_plugin.cpp @@ -927,6 +927,12 @@ VstIntPtr RemoteVstPlugin::hostCallback( AEffect * _effect, VstInt32 _opcode, SHOW_CALLBACK( buf ); #endif + // workaround for early callbacks by some plugins + if( __plugin && __plugin->m_plugin == NULL ) + { + __plugin->m_plugin = _effect; + } + switch( _opcode ) { case audioMasterAutomate: