mirror of https://github.com/f4exb/sdrangel.git
Sample MO FIFO: capping requested amount of samples to vector size
This commit is contained in:
parent
08eaca8c0c
commit
7712013b9b
|
@ -105,7 +105,7 @@ void SampleMOFifo::readSync(
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
unsigned int remaining = amount - spaceLeft;
|
unsigned int remaining = (amount < m_size ? amount : m_size) - spaceLeft;
|
||||||
ipart1Begin = m_readHead;
|
ipart1Begin = m_readHead;
|
||||||
ipart1End = m_size;
|
ipart1End = m_size;
|
||||||
ipart2Begin = 0;
|
ipart2Begin = 0;
|
||||||
|
@ -132,7 +132,7 @@ void SampleMOFifo::writeSync(const std::vector<SampleVector::iterator>& vbegin,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
unsigned int remaining = amount - spaceLeft;
|
unsigned int remaining = (amount < m_size ? amount : m_size) - spaceLeft;
|
||||||
|
|
||||||
for (unsigned int stream = 0; stream < m_nbStreams; stream++)
|
for (unsigned int stream = 0; stream < m_nbStreams; stream++)
|
||||||
{
|
{
|
||||||
|
@ -163,7 +163,7 @@ void SampleMOFifo::writeSync(
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
unsigned int remaining = amount - spaceLeft;
|
unsigned int remaining = (amount < m_size ? amount : m_size) - spaceLeft;
|
||||||
ipart1Begin = m_writeHead;
|
ipart1Begin = m_writeHead;
|
||||||
ipart1End = m_size;
|
ipart1End = m_size;
|
||||||
ipart2Begin = 0;
|
ipart2Begin = 0;
|
||||||
|
@ -233,7 +233,7 @@ void SampleMOFifo::readAsync(
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
unsigned int remaining = amount - spaceLeft;
|
unsigned int remaining = (amount < m_size ? amount : m_size) - spaceLeft;
|
||||||
ipart1Begin = m_vReadHead[stream];
|
ipart1Begin = m_vReadHead[stream];
|
||||||
ipart1End = m_size;
|
ipart1End = m_size;
|
||||||
ipart2Begin = 0;
|
ipart2Begin = 0;
|
||||||
|
@ -257,7 +257,7 @@ void SampleMOFifo::writeAsync(const SampleVector::iterator& begin, unsigned int
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
unsigned int remaining = amount - spaceLeft;
|
unsigned int remaining = (amount < m_size ? amount : m_size) - spaceLeft;
|
||||||
|
|
||||||
for (unsigned int stream = 0; stream < m_nbStreams; stream++)
|
for (unsigned int stream = 0; stream < m_nbStreams; stream++)
|
||||||
{
|
{
|
||||||
|
@ -288,7 +288,7 @@ void SampleMOFifo::writeAsync(
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
unsigned int remaining = amount - spaceLeft;
|
unsigned int remaining = (amount < m_size ? amount : m_size) - spaceLeft;
|
||||||
ipart1Begin = m_vWriteHead[stream];
|
ipart1Begin = m_vWriteHead[stream];
|
||||||
ipart1End = m_size;
|
ipart1End = m_size;
|
||||||
ipart2Begin = 0;
|
ipart2Begin = 0;
|
||||||
|
|
Loading…
Reference in New Issue