1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-07-15 16:17:41 +02:00

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.
This commit is contained in:
lllucius 2015-01-10 02:14:19 +00:00
parent d87c6942cd
commit a47fc62bb1

View File

@ -1389,7 +1389,7 @@ intptr_t VSTEffect::AudioMaster(AEffect * effect,
void * ptr, void * ptr,
float opt) 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 // Handles operations during initialization...before VSTEffect has had a
// chance to set its instance pointer. // 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 // Note: Some hosts use "user" and some use "ptr2/resvd2". It might
// be worthwhile to check if user is NULL before using it and // be worthwhile to check if user is NULL before using it and
// then falling back to "ptr2/resvd2". // then falling back to "ptr2/resvd2".
mAEffect->user = this; mAEffect->ptr2 = this;
// Give the plugin an initial sample rate and blocksize // Give the plugin an initial sample rate and blocksize
callDispatcher(effSetSampleRate, 0, 0, NULL, 48000.0); callDispatcher(effSetSampleRate, 0, 0, NULL, 48000.0);