1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-06-01 21:54:55 -04:00

Remote input buffer size rework: dynamically allocated number of decoder slots. Implements #534

This commit is contained in:
f4exb
2020-06-28 08:17:39 +02:00
parent 385d8cc2db
commit 206eaff050
4 changed files with 24 additions and 1 deletions
@@ -98,6 +98,11 @@ void RemoteInputBuffer::setNbDecoderSlots(int nbDecoderSlots)
m_frameHead = -1;
}
void RemoteInputBuffer::setBufferLenSec(const RemoteMetaDataFEC& metaData)
{
m_bufferLenSec = (float) m_framesNbBytes / (float) (metaData.m_sampleRate * metaData.m_sampleBytes * 2);
}
void RemoteInputBuffer::initDecodeAllSlots()
{
for (int i = 0; i < m_nbDecoderSlots; i++)
@@ -343,7 +348,7 @@ void RemoteInputBuffer::writeData(char *array)
if (sampleRate != 0)
{
m_bufferLenSec = (float) m_framesNbBytes / (float) (sampleRate * metaData->m_sampleBytes * 2);
setBufferLenSec(*metaData);
m_balCorrLimit = sampleRate / 400; // +/- 5% correction max per read
m_readNbBytes = (sampleRate * metaData->m_sampleBytes * 2) / 20;
}