mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-10 15:46:42 +02:00
test
git-svn-id: svn://elaine/murooma/trunk@23 d8a302eb-03bc-478d-80e4-98257eca68ef
This commit is contained in:
parent
c0cae09478
commit
de8e1f3c01
1 changed files with 16 additions and 2 deletions
18
client.cpp
18
client.cpp
|
@ -85,7 +85,7 @@ void player()
|
|||
if (chunks.empty())
|
||||
cv.wait(lck);
|
||||
mutex.lock();
|
||||
// std::cerr << "Chunks: " << chunks.size() << "\n";
|
||||
std::cerr << "Chunks: " << chunks.size() << "\n";
|
||||
Chunk* chunk = chunks.front();
|
||||
chunks.pop_front();
|
||||
mutex.unlock();
|
||||
|
@ -94,7 +94,21 @@ void player()
|
|||
|
||||
if (playing)
|
||||
{
|
||||
for (size_t n=0; n<size; ++n)
|
||||
std::cout << chunk->payload[n];// << std::flush;
|
||||
std::cout << std::flush;
|
||||
|
||||
int age = getAge(*chunk) - bufferMs;
|
||||
std::cerr << "Age: " << age << "\n";
|
||||
if (age < 0)
|
||||
{
|
||||
std::cerr << "Sleeping, age: " << age / 2 << "\n";
|
||||
usleep((-age / 2) * 1000 - 100);
|
||||
}
|
||||
else
|
||||
std::cerr << "Dropping Chunk, age: " << age << "\n";
|
||||
|
||||
/* int age = getAge(*chunk) - bufferMs;
|
||||
if (age < 10)
|
||||
{
|
||||
if (age < 0)
|
||||
|
@ -115,7 +129,7 @@ void player()
|
|||
}
|
||||
else
|
||||
std::cerr << "Dropping Chunk, age: " << age << "\n";
|
||||
}
|
||||
*/ }
|
||||
delete chunk;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue