mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2024-11-27 06:08:37 -05:00
Fix for an initial priming overload and visuals memory leak
This commit is contained in:
parent
9de7bc95fb
commit
1d5a2f1ac7
@ -78,9 +78,11 @@ bool CubicSDR::OnInit() {
|
||||
scopeProcessor.setInput(pipeAudioVisualData);
|
||||
|
||||
// I/Q Data
|
||||
pipeSDRIQData = new SDRThreadIQDataQueue;
|
||||
pipeSDRIQData = new SDRThreadIQDataQueue();
|
||||
pipeSDRCommand = new SDRThreadCommandQueue();
|
||||
|
||||
pipeSDRIQData->set_max_num_items(1);
|
||||
|
||||
sdrThread = new SDRThread();
|
||||
sdrThread->setInputQueue("SDRCommandQueue",pipeSDRCommand);
|
||||
sdrThread->setOutputQueue("IQDataOutput",pipeSDRIQData);
|
||||
|
@ -5,6 +5,7 @@
|
||||
#include <deque>
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
|
||||
#include "ThreadQueue.h"
|
||||
|
||||
@ -63,6 +64,10 @@ public:
|
||||
return buf;
|
||||
}
|
||||
|
||||
// if (outputBuffers.size() > 100) {
|
||||
// std::cout << "Buffer over 100.." << std::endl;
|
||||
// }
|
||||
|
||||
buf = new BufferType();
|
||||
outputBuffers.push_back(buf);
|
||||
|
||||
|
@ -94,7 +94,7 @@ void DemodulatorThread::run() {
|
||||
while (!terminated) {
|
||||
DemodulatorThreadPostIQData *inp;
|
||||
iqInputQueue->pop(inp);
|
||||
std::lock_guard < std::mutex > lock(inp->m_mutex);
|
||||
// std::lock_guard < std::mutex > lock(inp->m_mutex);
|
||||
|
||||
int bufSize = inp->data.size();
|
||||
|
||||
|
@ -86,6 +86,8 @@ void SDRPostThread::run() {
|
||||
std::vector<liquid_float_complex> fpData;
|
||||
std::vector<liquid_float_complex> dataOut;
|
||||
|
||||
iqDataInQueue->set_max_num_items(30);
|
||||
|
||||
while (!terminated) {
|
||||
SDRThreadIQData *data_in;
|
||||
|
||||
@ -203,8 +205,12 @@ void SDRPostThread::run() {
|
||||
}
|
||||
|
||||
if (iqDataOutQueue != NULL) {
|
||||
iqDataOutQueue->push(demodDataOut);
|
||||
pushedData = true;
|
||||
if (!iqDataOutQueue->full()) {
|
||||
iqDataOutQueue->push(demodDataOut);
|
||||
pushedData = true;
|
||||
} else {
|
||||
demodDataOut->decRefCount();
|
||||
}
|
||||
}
|
||||
|
||||
if (!pushedData && iqDataOutQueue == NULL) {
|
||||
|
Loading…
Reference in New Issue
Block a user