1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2025-09-02 13:17:48 -04:00

FileSink plugin: use larger buffer in thread

This commit is contained in:
f4exb 2016-12-20 00:26:43 +01:00
parent 77549e74ca
commit cd3191a9dc
2 changed files with 9 additions and 1 deletions

View File

@ -51,6 +51,7 @@ void FileSinkThread::startWork()
if (m_ofstream->is_open()) if (m_ofstream->is_open())
{ {
qDebug() << "FileSinkThread::startWork: file stream open, starting..."; qDebug() << "FileSinkThread::startWork: file stream open, starting...";
m_maxThrottlems = 0;
m_startWaitMutex.lock(); m_startWaitMutex.lock();
m_elapsedTimer.start(); m_elapsedTimer.start();
start(); start();
@ -85,7 +86,7 @@ void FileSinkThread::setSamplerate(int samplerate)
// resize sample FIFO // resize sample FIFO
if (m_sampleFifo) { 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; m_samplerate = samplerate;
@ -127,6 +128,12 @@ void FileSinkThread::tick()
m_throttleToggle = !m_throttleToggle; m_throttleToggle = !m_throttleToggle;
} }
// if (m_throttlems > m_maxThrottlems)
// {
// qDebug("FileSinkThread::tick: m_maxThrottlems: %d", m_maxThrottlems);
// m_maxThrottlems = m_throttlems;
// }
SampleVector::iterator readUntil; SampleVector::iterator readUntil;
m_sampleFifo->readAdvance(readUntil, m_samplesChunkSize); m_sampleFifo->readAdvance(readUntil, m_samplesChunkSize);

View File

@ -62,6 +62,7 @@ private:
int m_samplerate; int m_samplerate;
int m_throttlems; int m_throttlems;
int m_maxThrottlems;
QElapsedTimer m_elapsedTimer; QElapsedTimer m_elapsedTimer;
bool m_throttleToggle; bool m_throttleToggle;