Make sure n_read is > 0 ..

This commit is contained in:
Charles J. Cliffe 2015-09-19 22:30:00 -04:00
parent 7f2f3d95d2
commit d551d5f2c4

View File

@ -276,6 +276,7 @@ void SDRThread::run() {
// std::cout << n_read << ", " << timeNs << std::endl; // std::cout << n_read << ", " << timeNs << std::endl;
if (n_read > 0) {
SDRThreadIQData *dataOut = buffers.getBuffer(); SDRThreadIQData *dataOut = buffers.getBuffer();
dataOut->setRefCount(1); dataOut->setRefCount(1);
@ -290,7 +291,7 @@ void SDRThread::run() {
} else { } else {
dataOut->setRefCount(0); dataOut->setRefCount(0);
} }
}
} }
device->deactivateStream(stream); device->deactivateStream(stream);
device->closeStream(stream); device->closeStream(stream);