Mercurial > hg > beaglert
diff core/NetworkSend.cpp @ 222:6a23c07d0fbb mergingClockSync
Working with UdpIoPlugin
author | Giulio Moro <giuliomoro@yahoo.it> |
---|---|
date | Sun, 14 Feb 2016 01:09:23 +0000 |
parents | 46bd63a50933 |
children | e4392164b458 |
line wrap: on
line diff
--- a/core/NetworkSend.cpp Sat Feb 13 16:56:29 2016 +0000 +++ b/core/NetworkSend.cpp Sun Feb 14 01:09:23 2016 +0000 @@ -106,7 +106,7 @@ #endif /* USE_JUCE */ cleanup(); int numSamples=blockSize*4>4*channel.bufferLength ? blockSize*4 : 4*channel.bufferLength; - channel.numBuffers= 1+numSamples/channel.bufferLength; //the +1 takes the ceil() of the division + channel.numBuffers= (1+numSamples/channel.bufferLength) * 3; //the +1 takes the ceil() of the division channel.buffers=(float**)malloc(channel.numBuffers*sizeof(float*)); printf("NumBuffers: %d\n", channel.numBuffers); if(channel.buffers==NULL) @@ -143,7 +143,7 @@ channel.writePointer=channel.headerLength; //reset the writePointer channel.writeBuffer=(channel.writeBuffer+1); //switch buffer if(channel.writeBuffer==channel.numBuffers) // and wrap it - channel.writeBuffer=0; + channel.writeBuffer=0; // printf("WriteBuffer:%d\n", channel.writeBuffer); if(channel.doneOnTime[channel.writeBuffer]==false){ //check if this buffer's last sending has completed on time ... printf("NetworkSend buffer underrun. timestamp: %d :-{\n",