1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-09-28 15:56:33 -04:00

LimeSDR input: start and stop stream before and after the read loop. Use actual number of samples for callback

This commit is contained in:
f4exb 2017-04-18 13:56:05 +02:00
parent 65cccbdd75
commit d3312c90d4

View File

@ -70,6 +70,12 @@ void LimeSDRInputThread::run()
m_running = true; m_running = true;
m_startWaiter.wakeAll(); m_startWaiter.wakeAll();
if (LMS_StartStream(m_stream) < 0) {
qCritical("LimeSDRInputThread::run: could not start stream");
} else {
qDebug("LimeSDRInputThread::run: stream started");
}
while (m_running) while (m_running)
{ {
if ((res = LMS_RecvStream(m_stream, (void *) m_buf, LIMESDR_BLOCKSIZE, &metadata, 1000)) < 0) if ((res = LMS_RecvStream(m_stream, (void *) m_buf, LIMESDR_BLOCKSIZE, &metadata, 1000)) < 0)
@ -78,7 +84,14 @@ void LimeSDRInputThread::run()
break; break;
} }
callback(m_buf, 2 * LIMESDR_BLOCKSIZE); callback(m_buf, 2 * res);
}
if (LMS_StopStream(m_stream) < 0) {
qCritical("LimeSDRInputThread::run: could not stop stream");
} else {
qDebug("LimeSDRInputThread::run: stream stopped");
} }
m_running = false; m_running = false;