Permalink
Browse files

Device playack fix for interleaved channel mappings

  • Loading branch information...
1 parent 65ffb87 commit 716cba0e078e5bc635d80b18b88679ffa615ffe2 @ndonald2 ndonald2 committed Jul 18, 2013
Showing with 8 additions and 1 deletion.
  1. +8 −1 Novocaine/Novocaine.m
View
@@ -792,7 +792,14 @@ OSStatus renderCallback (void *inRefCon,
int thisNumChannels = ioData->mBuffers[iBuffer].mNumberChannels;
for (int iChannel = 0; iChannel < thisNumChannels; ++iChannel) {
- vDSP_vsadd(sm.outData+iChannel+iBuffer, sm.numOutputChannels, &zero, (float *)ioData->mBuffers[iBuffer].mData, thisNumChannels, inNumberFrames);
+
+ int interleaveOffset = iChannel;
+ if (iBuffer < sm.numOutputChannels){
+ interleaveOffset += iBuffer;
+ }
+
+ vDSP_vsadd(sm.outData+interleaveOffset, sm.numOutputChannels, &zero, (float *)ioData->mBuffers[iBuffer].mData, thisNumChannels, inNumberFrames);
+
}
}
}

0 comments on commit 716cba0

Please sign in to comment.