Does anybody have any idea why this code, though it returns noErr, will crash the app only a few steps in?:
AURenderCallbackStruct nilCallback;
nilCallback.inputProc = nil;
nilCallback.inputProcRefCon = nil;
OSStatus err;
err = AudioUnitSetProperty(audioUnit, kAudioUnitProperty_SetRenderCallback, kAudioUnitScope_Input, 0, &nilCallback, sizeof(nilCallback));
===
I've tried calling this from the main thread.
I've tried calling this inbetween renders (using an NSLock)
I've tried calling this on a preRender notification, inside the CoreAudio thread
All of them fail similarly - a few steps in with the debugger and it seems like the stack is corrupted.
Is there any other way to safely clear a render callback from an AudioUnit? I'm using Leopard - one of the previous posts said there would be a new API for this in Leopard... am I missing it?