mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-02-03 09:44:01 -05:00
Tx ph.1: fixed sample source FIFO
This commit is contained in:
parent
f87b714ac7
commit
8f70840561
File diff suppressed because it is too large
Load Diff
@ -57,14 +57,14 @@ void SampleSourceFifo::read(SampleVector::iterator& beginRead, unsigned int nbSa
|
|||||||
}
|
}
|
||||||
else if (i_delta > 0)
|
else if (i_delta > 0)
|
||||||
{
|
{
|
||||||
if (i_delta < m_samplesChunkSize)
|
if (i_delta <= m_samplesChunkSize)
|
||||||
{
|
{
|
||||||
emit dataWrite();
|
emit dataWrite();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (i_delta + m_size < m_samplesChunkSize)
|
if (i_delta + m_size <= m_samplesChunkSize)
|
||||||
{
|
{
|
||||||
emit dataWrite();
|
emit dataWrite();
|
||||||
}
|
}
|
||||||
@ -87,13 +87,14 @@ void SampleSourceFifo::getWriteIterator(SampleVector::iterator& writeAt)
|
|||||||
writeAt = m_data.begin() + m_iw;
|
writeAt = m_data.begin() + m_iw;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SampleSourceFifo::bumpIndex()
|
void SampleSourceFifo::bumpIndex(SampleVector::iterator& writeAt)
|
||||||
{
|
{
|
||||||
m_data[m_iw+m_size] = m_data[m_iw];
|
m_data[m_iw+m_size] = m_data[m_iw];
|
||||||
m_iw = (m_iw+1) % m_size;
|
|
||||||
|
|
||||||
{
|
{
|
||||||
QMutexLocker mutexLocker(&m_mutex);
|
QMutexLocker mutexLocker(&m_mutex);
|
||||||
m_iw = (m_iw+1) % m_size;
|
m_iw = (m_iw+1) % m_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
writeAt = m_data.begin() + m_iw;
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,7 @@ public:
|
|||||||
void read(SampleVector::iterator& beginRead, unsigned int nbSamples);
|
void read(SampleVector::iterator& beginRead, unsigned int nbSamples);
|
||||||
|
|
||||||
void getWriteIterator(SampleVector::iterator& writeAt); //!< get iterator to current item for update - write phase 1
|
void getWriteIterator(SampleVector::iterator& writeAt); //!< get iterator to current item for update - write phase 1
|
||||||
void bumpIndex(); //!< copy current item to second buffer and bump write index - write phase 2
|
void bumpIndex(SampleVector::iterator& writeAt); //!< copy current item to second buffer and bump write index - write phase 2
|
||||||
|
|
||||||
void write(const Sample& sample); //!< write directly - phase 1 + phase 2
|
void write(const Sample& sample); //!< write directly - phase 1 + phase 2
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user