1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-12-23 01:55:48 -05:00

File source thread: changed chunk size and buffer size calculation so it is set in only one place

This commit is contained in:
f4exb 2015-08-06 00:10:23 +02:00
parent 23ec969a4d
commit afdcf138d2

View File

@ -86,7 +86,8 @@ void FileSourceThread::setSamplerate(int samplerate)
} }
m_samplerate = samplerate; m_samplerate = samplerate;
m_bufsize = (m_samplerate / m_rateDivider)*4; m_chunksize = (m_samplerate / m_rateDivider)*4; // TODO: implement FF and slow motion here. 4 corresponds to live. 2 is half speed, 8 is doulbe speed
m_bufsize = m_chunksize;
if (m_buf == 0) { if (m_buf == 0) {
std::cerr << " Allocate buffer"; std::cerr << " Allocate buffer";
@ -104,8 +105,7 @@ void FileSourceThread::setSamplerate(int samplerate)
std::cerr << std::endl; std::cerr << std::endl;
} }
m_samplerate = samplerate; //m_samplerate = samplerate;
m_chunksize = (m_samplerate / m_rateDivider)*4;
} }
void FileSourceThread::run() void FileSourceThread::run()