From 1c19e1b69e876bdd54333bc82aa70e0c1945cdfe Mon Sep 17 00:00:00 2001 From: Jeremy Salwen Date: Sat, 4 Jun 2011 04:44:32 -0400 Subject: [PATCH] properly handle output buffering. --- kn0ck0ut6.cpp | 39 +++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/kn0ck0ut6.cpp b/kn0ck0ut6.cpp index f399a28..239e8e6 100644 --- a/kn0ck0ut6.cpp +++ b/kn0ck0ut6.cpp @@ -151,7 +151,16 @@ void AKnockout::do_rebuild(long numSampsToProcess, long fftFrameSize, long osamp { static long gRover=false; - static long outAccumIndex=0; + static long outAccumIndex=0; + static long copiesremaining=0; + + if(numSampsToProcess(numSampsToProcess-i-1)) { + numcopy=numSampsToProcess-i-1; + copiesremaining=stepSize-numcopy; + copiesremaining*=(copiesremaining>0); + } + outAccumIndex=copy_from_circular_buffer(fftFrameSize,(outdata+i),gOutputAccum,outAccumIndex,numcopy); + memmove (gInFIFO, gInFIFO+stepSize, inFifoLatency*sizeof(float)); memmove (gInFIFO2, gInFIFO2+stepSize, inFifoLatency*sizeof(float));