buffering

git-svn-id: svn://elaine/murooma/trunk@41 d8a302eb-03bc-478d-80e4-98257eca68ef
This commit is contained in:
(no author) 2014-06-29 11:44:37 +00:00
parent 3b40a08f1e
commit 1b1200e88c
2 changed files with 4 additions and 4 deletions

View file

@ -21,7 +21,7 @@
#include "doubleBuffer.h"
DoubleBuffer<int> buffer(60000 / MS);
DoubleBuffer<int> buffer(30000 / MS);
std::deque<Chunk*> chunks;
std::deque<int> timeDiffs;
std::mutex mtx;
@ -189,14 +189,14 @@ static int patestCallback( const void *inputBuffer, void *outputBuffer,
int median = buffer.median();
std::cerr << "age: " << getAge(*chunk) << "\t" << age << "\t" << median << "\t" << buffer.size() << "\t" << timeInfo->outputBufferDacTime*1000 << "\n";
if (!buffer.full() && (age > bufferMs + 2*MS))
if (/*!buffer.full() &&*/ (age > bufferMs + 2*MS))
{
chunks->pop_front();
delete chunk;
std::cerr << "packe too old, dropping\n";
usleep(100);
}
else if (!buffer.full() && (age < bufferMs - 2*MS))
else if (/*!buffer.full() &&*/ (age < bufferMs - 2*MS))
{
chunk = new Chunk();
memset(&(chunk->payload[0]), 0, SIZE);