iOS 0.1.1: effects read the input where the host puts it (were silent out of process)

Out of process the pulled input arrives by pointer, not in the buffers the
plugin offered. au_test now drives the render block with such an upstream;
it fails on 0.1.0 and passes now.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Reactorcoremeltdown
2026-11-14 21:07:05 +01:00
co-authored by Claude Opus 5.5
parent dcf85ba915
commit 7d8311a77f
6 changed files with 95 additions and 10 deletions
+5 -2
View File
@@ -346,7 +346,9 @@ static NSString *const kStateKey = @"sizzleValues";
AURenderPullInputBlock pullInputBlock) {
if (frameCount > k->inBuf[0].size() || !pullInputBlock) return kAudioUnitErr_TooManyFramesToProcess;
// Pull the input into our own buffers.
// Pull the input, offering our own buffers. The upstream may instead point
// mData at its own memory (it does out of process, i.e. in every real host),
// so the samples are wherever in.list points afterwards, not necessarily inBuf.
struct { AudioBufferList list; AudioBuffer extra; } in;
in.list.mNumberBuffers = (UInt32)k->channels;
for (int c = 0; c < k->channels; ++c) {
@@ -383,7 +385,8 @@ static NSString *const kStateKey = @"sizzleValues";
bool bypass = k->bypass.load(std::memory_order_relaxed);
for (int c = 0; c < k->channels && c < (int)outputData->mNumberBuffers; ++c) {
float *src = k->inBuf[c].data();
float *src = (float *)in.list.mBuffers[c].mData;
if (!src) return kAudioUnitErr_NoConnection;
if (!outputData->mBuffers[c].mData) outputData->mBuffers[c].mData = src; // in place
float *dst = (float *)outputData->mBuffers[c].mData;
outputData->mBuffers[c].mDataByteSize = frameCount * sizeof(float);