buffer size

git-svn-id: svn://elaine/murooma/trunk@77 d8a302eb-03bc-478d-80e4-98257eca68ef
This commit is contained in:
(no author) 2014-07-07 04:45:17 +00:00
parent 5361199d87
commit 36e0ffe7ee
3 changed files with 10 additions and 1 deletions

View file

@ -15,6 +15,12 @@ Stream::Stream() : sleep(0), lastPlayerChunk(NULL), median(0), shortMedian(0), l
}
void Stream::setBufferLen(size_t bufferLenMs)
{
bufferMs = bufferLenMs;
}
void Stream::addChunk(Chunk* chunk)
{
Chunk* c = new Chunk(*chunk);
@ -213,7 +219,7 @@ void Stream::getChunk(short* outputBuffer, double outputBufferDacTime, unsigned
lastUpdate = now;
median = pBuffer->median();
shortMedian = pShortBuffer->median();
if (abs(age) > 300)
if (abs(age) > 700)
sleep = age;
else if (pShortBuffer->full() && (abs(shortMedian) > WIRE_CHUNK_MS))
sleep = shortMedian;