From a47fc62bb16971f8935784066a1e8f87da7f9380 Mon Sep 17 00:00:00 2001 From: lllucius Date: Sat, 10 Jan 2015 02:14:19 +0000 Subject: [PATCH] Use the correct reserved field in the AEffect struct Some hosts (like Ardour) use the "user" field and some use the resvd2 field. In 2.0.6 I'd switced from resvd2 to user. This fix puts it back to resv2 since at least one plugin, Audiocation Phase, uses the "user" field for its own purposes and rightly so. --- src/effects/VST/VSTEffect.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/effects/VST/VSTEffect.cpp b/src/effects/VST/VSTEffect.cpp index 30ff09b09..e7b7eaabe 100644 --- a/src/effects/VST/VSTEffect.cpp +++ b/src/effects/VST/VSTEffect.cpp @@ -1389,7 +1389,7 @@ intptr_t VSTEffect::AudioMaster(AEffect * effect, void * ptr, float opt) { - VSTEffect *vst = (effect ? (VSTEffect *) effect->user : NULL); + VSTEffect *vst = (effect ? (VSTEffect *) effect->ptr2 : NULL); // Handles operations during initialization...before VSTEffect has had a // chance to set its instance pointer. @@ -2677,7 +2677,7 @@ bool VSTEffect::Load() // Note: Some hosts use "user" and some use "ptr2/resvd2". It might // be worthwhile to check if user is NULL before using it and // then falling back to "ptr2/resvd2". - mAEffect->user = this; + mAEffect->ptr2 = this; // Give the plugin an initial sample rate and blocksize callDispatcher(effSetSampleRate, 0, 0, NULL, 48000.0);