1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-25 17:28:50 -05:00

Add option to AudioFifo to accept any sample size

This commit is contained in:
f4exb 2022-06-04 12:27:57 +02:00
parent cb09035fa3
commit 63e41e18ef
2 changed files with 9 additions and 1 deletions

View File

@ -63,6 +63,13 @@ bool AudioFifo::setSize(uint32_t numSamples)
return create(numSamples);
}
bool AudioFifo::setSampleSize(uint32_t sampleSize, uint32_t numSamples)
{
QMutexLocker mutexLocker(&m_mutex);
m_sampleSize = sampleSize;
return create(numSamples);
}
uint32_t AudioFifo::write(const quint8* data, uint32_t numSamples)
{
uint32_t total;

View File

@ -34,6 +34,7 @@ public:
~AudioFifo();
bool setSize(uint32_t numSamples);
bool setSampleSize(uint32_t sampleSize, uint32_t numSamples);
uint32_t write(const quint8* data, uint32_t numSamples);
uint32_t read(quint8* data, uint32_t numSamples);
@ -53,7 +54,7 @@ private:
qint8* m_fifo;
const uint32_t m_sampleSize;
uint32_t m_sampleSize;
uint32_t m_size;
uint32_t m_fill;