mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-29 00:46:17 +02:00
buffering
git-svn-id: svn://elaine/murooma/trunk@30 d8a302eb-03bc-478d-80e4-98257eca68ef
This commit is contained in:
parent
e77afd841f
commit
179744fa91
1 changed files with 7 additions and 4 deletions
11
client.cpp
11
client.cpp
|
@ -186,12 +186,15 @@ static int patestCallback( const void *inputBuffer, void *outputBuffer,
|
|||
mutex.unlock();
|
||||
age = getAge(*chunk) + timeInfo->outputBufferDacTime*1000;
|
||||
std::cerr << "age: " << getAge(*chunk) << "\t" << age << "\n";
|
||||
if (age > bufferMs + 50)
|
||||
delete chunk;
|
||||
else if (age < bufferMs - 50)
|
||||
if (age > bufferMs + 150)
|
||||
{
|
||||
usleep(((bufferMs - age) + 50) * 1000);
|
||||
delete chunk;
|
||||
usleep(100);
|
||||
}
|
||||
else if (age < bufferMs)
|
||||
{
|
||||
usleep(((bufferMs - age)) * 1000);
|
||||
break;
|
||||
}
|
||||
else
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue