Permalink
Browse files

Split number of items to read from buffer into two lines

  • Loading branch information...
jsiegle
jsiegle committed Jan 28, 2014
1 parent 17a1b22 commit bc0e18391aaefcf440153f59b9b4750e711f68f1
Showing with 8 additions and 2 deletions.
  1. +8 −2 Source/Processors/DataThreads/DataBuffer.cpp
@@ -79,8 +79,14 @@ int DataBuffer::getNumSamples()
int DataBuffer::readAllFromBuffer(AudioSampleBuffer& data, uint64* timestamp, int16* eventCodes, int maxSize)
{
// check to see if the maximum size is smaller than the total number of available ints
- int numItems = (maxSize < abstractFifo.getNumReady()) ?
- maxSize : abstractFifo.getNumReady();
+
+ // Better version (1/27/14)?
+ int numReady = abstractFifo.getNumReady());
+ int numItems = (maxSize < numReady ) ? maxSize : numReady;
+
+ // Original version:
+ //int numItems = (maxSize < abstractFifo.getNumReady()) ?
+ // maxSize : abstractFifo.getNumReady();
int startIndex1, blockSize1, startIndex2, blockSize2;
abstractFifo.prepareToRead(numItems, startIndex1, blockSize1, startIndex2, blockSize2);

0 comments on commit bc0e183

Please sign in to comment.