Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Split number of items to read from buffer into two lines

  • Loading branch information...
commit bc0e18391aaefcf440153f59b9b4750e711f68f1 1 parent 17a1b22
jsiegle authored
Showing with 8 additions and 2 deletions.
  1. +8 −2 Source/Processors/DataThreads/DataBuffer.cpp
View
10 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);
Please sign in to comment.
Something went wrong with that request. Please try again.