Changeset - 20096d6c5a5f
[Not reviewed]
default
0 1 0
Hasan Yavuz Ă–ZDERYA - 9 years ago 2016-08-12 16:59:40
hy@ozderya.net
fixed pause not working on custom frame format reader
1 file changed with 7 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/framedreader.cpp
Show inline comments
 
@@ -272,12 +272,19 @@ void FramedReader::reset()
 
    calcChecksum = 0;
 
}
 

	
 
// Important: this function assumes device has enough bytes to read a full frames data and checksum
 
void FramedReader::readFrameDataAndCheck()
 
{
 
    // if paused just read and waste data
 
    if (paused)
 
    {
 
        _device->read((checksumEnabled ? frameSize+1 : frameSize));
 
        return;
 
    }
 

	
 
    // a package is 1 set of samples for all channels
 
    unsigned numOfPackagesToRead = frameSize / (_numOfChannels * sampleSize);
 
    double* channelSamples = new double[numOfPackagesToRead * _numOfChannels];
 

	
 
    for (unsigned i = 0; i < numOfPackagesToRead; i++)
 
    {
0 comments (0 inline, 0 general)