mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2024-11-26 13:48:38 -05:00
MISC 1 : Create ReBuffer by default with refcount 1, so remove redundant refCount(1) evertwhere
This commit is contained in:
parent
1e2f12a571
commit
4ec08b8b68
@ -24,6 +24,11 @@ class ReferenceCounter {
|
||||
|
||||
public:
|
||||
|
||||
//default constructor, initialized with refcont 1, sounds very natural
|
||||
ReferenceCounter() {
|
||||
refCount = 1;
|
||||
}
|
||||
|
||||
// void setIndex(int idx) {
|
||||
// std::lock_guard < std::recursive_mutex > lock(m_mutex);
|
||||
// index = idx;
|
||||
@ -139,8 +144,8 @@ public:
|
||||
std::cout << "Warning: ReBuffer '" << bufferId << "' count '" << outputBuffers.size() << "' exceeds threshold of '" << REBUFFER_WARNING_THRESHOLD << "'" << std::endl;
|
||||
}
|
||||
|
||||
//by default created with refcount = 1
|
||||
buf = new BufferType();
|
||||
buf->setRefCount(1);
|
||||
// buf->setIndex(indexCounter++);
|
||||
outputBuffers.push_back(buf);
|
||||
|
||||
|
@ -198,7 +198,6 @@ void DemodulatorPreThread::run() {
|
||||
unsigned int numWritten;
|
||||
msresamp_crcf_execute(iqResampler, in_buf, bufSize, &resampledData[0], &numWritten);
|
||||
|
||||
resamp->setRefCount(1);
|
||||
resamp->data.assign(resampledData.begin(), resampledData.begin() + numWritten);
|
||||
|
||||
resamp->modemType = cModem->getType();
|
||||
|
@ -120,7 +120,6 @@ void DemodulatorThread::run() {
|
||||
|
||||
modemData.sampleRate = inp->sampleRate;
|
||||
modemData.data.assign(inputData->begin(), inputData->end());
|
||||
modemData.setRefCount(1);
|
||||
|
||||
AudioThreadInput *ati = nullptr;
|
||||
|
||||
@ -186,7 +185,6 @@ void DemodulatorThread::run() {
|
||||
if (ati && localAudioVisOutputQueue != nullptr && localAudioVisOutputQueue->empty()) {
|
||||
AudioThreadInput *ati_vis = new AudioThreadInput;
|
||||
|
||||
ati_vis->setRefCount(1);
|
||||
ati_vis->sampleRate = inp->sampleRate;
|
||||
ati_vis->inputRate = inp->sampleRate;
|
||||
|
||||
|
@ -207,7 +207,6 @@ void SDRThread::readStream(SDRThreadIQDataQueue* iqDataOutQueue) {
|
||||
dataOut->data.assign(inpBuffer.data.begin(), inpBuffer.data.begin()+n_read);
|
||||
}
|
||||
|
||||
dataOut->setRefCount(1);
|
||||
dataOut->frequency = frequency.load();
|
||||
dataOut->sampleRate = sampleRate.load();
|
||||
dataOut->dcCorrected = hasHardwareDC.load();
|
||||
|
Loading…
Reference in New Issue
Block a user