mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-02-03 09:44:01 -05:00
FileSink plugin: use larger buffer in thread
This commit is contained in:
parent
77549e74ca
commit
cd3191a9dc
@ -51,6 +51,7 @@ void FileSinkThread::startWork()
|
||||
if (m_ofstream->is_open())
|
||||
{
|
||||
qDebug() << "FileSinkThread::startWork: file stream open, starting...";
|
||||
m_maxThrottlems = 0;
|
||||
m_startWaitMutex.lock();
|
||||
m_elapsedTimer.start();
|
||||
start();
|
||||
@ -85,7 +86,7 @@ void FileSinkThread::setSamplerate(int samplerate)
|
||||
|
||||
// resize sample FIFO
|
||||
if (m_sampleFifo) {
|
||||
m_sampleFifo->resize(samplerate, samplerate/4); // 1s buffer with 250ms write chunk size
|
||||
m_sampleFifo->resize(2*samplerate, samplerate/2); // 2s buffer with 500ms write chunk size
|
||||
}
|
||||
|
||||
m_samplerate = samplerate;
|
||||
@ -127,6 +128,12 @@ void FileSinkThread::tick()
|
||||
m_throttleToggle = !m_throttleToggle;
|
||||
}
|
||||
|
||||
// if (m_throttlems > m_maxThrottlems)
|
||||
// {
|
||||
// qDebug("FileSinkThread::tick: m_maxThrottlems: %d", m_maxThrottlems);
|
||||
// m_maxThrottlems = m_throttlems;
|
||||
// }
|
||||
|
||||
SampleVector::iterator readUntil;
|
||||
|
||||
m_sampleFifo->readAdvance(readUntil, m_samplesChunkSize);
|
||||
|
@ -62,6 +62,7 @@ private:
|
||||
|
||||
int m_samplerate;
|
||||
int m_throttlems;
|
||||
int m_maxThrottlems;
|
||||
QElapsedTimer m_elapsedTimer;
|
||||
bool m_throttleToggle;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user