1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-22 16:08:39 -05:00

Sample source FIFO: write ahead the exact same amount of samples that were read. This smoothes out the process and avoids hickups

This commit is contained in:
f4exb 2017-01-09 02:13:27 +01:00
parent 188b05f58c
commit 09856b5941

View File

@ -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)