Permalink
Browse files

Handle interleaving offset for conversion as well

  • Loading branch information...
1 parent 716cba0 commit 7bbadda493962593856ec43d6ede44d4c4e1afe8 @ndonald2 ndonald2 committed Sep 9, 2013
Showing with 7 additions and 1 deletion.
  1. +7 −1 Novocaine/Novocaine.m
View
@@ -813,7 +813,13 @@ OSStatus renderCallback (void *inRefCon,
int thisNumChannels = ioData->mBuffers[iBuffer].mNumberChannels;
for (int iChannel = 0; iChannel < thisNumChannels; ++iChannel) {
- vDSP_vfix16(sm.outData+iChannel, sm.numOutputChannels, (SInt16 *)ioData->mBuffers[iBuffer].mData+iChannel, thisNumChannels, inNumberFrames);
+
+ int interleaveOffset = iChannel;
+ if (iBuffer < sm.numOutputChannels){
+ interleaveOffset += iBuffer;
+ }
+
+ vDSP_vfix16(sm.outData+interleaveOffset, sm.numOutputChannels, (SInt16 *)ioData->mBuffers[iBuffer].mData+iChannel, thisNumChannels, inNumberFrames);
}
}

0 comments on commit 7bbadda

Please sign in to comment.