From 09856b5941e22d4304028331f0be44bddb320af5 Mon Sep 17 00:00:00 2001 From: f4exb Date: Mon, 9 Jan 2017 02:13:27 +0100 Subject: [PATCH] Sample source FIFO: write ahead the exact same amount of samples that were read. This smoothes out the process and avoids hickups --- sdrbase/dsp/samplesourcefifo.cpp | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/sdrbase/dsp/samplesourcefifo.cpp b/sdrbase/dsp/samplesourcefifo.cpp index b7ce9ec57..90b79bf6d 100644 --- a/sdrbase/dsp/samplesourcefifo.cpp +++ b/sdrbase/dsp/samplesourcefifo.cpp @@ -54,28 +54,7 @@ void SampleSourceFifo::readAdvance(SampleVector::iterator& readUntil, unsigned i m_ir = (m_ir + nbSamples) % m_size; readUntil = m_data.begin() + m_size + m_ir; emit dataRead(nbSamples); - - int i_delta = m_iw - m_ir; - - if (m_init) - { - emit dataWrite(m_size/2); - m_init = false; - } - else if (i_delta > 0) - { - if (i_delta <= m_size/2) // m_samplesChunkSize) - { - emit dataWrite(m_size/2); - } - } - else - { - if (i_delta + m_size <= m_size/2) //m_samplesChunkSize) - { - emit dataWrite(m_size/2); - } - } + emit dataWrite(nbSamples); } void SampleSourceFifo::write(const Sample& sample)