mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-12 00:26:41 +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())
|
if (chunks.empty())
|
||||||
cv.wait(lck);
|
cv.wait(lck);
|
||||||
mutex.lock();
|
mutex.lock();
|
||||||
// std::cerr << "Chunks: " << chunks.size() << "\n";
|
std::cerr << "Chunks: " << chunks.size() << "\n";
|
||||||
Chunk* chunk = chunks.front();
|
Chunk* chunk = chunks.front();
|
||||||
chunks.pop_front();
|
chunks.pop_front();
|
||||||
mutex.unlock();
|
mutex.unlock();
|
||||||
|
@ -94,7 +94,21 @@ void player()
|
||||||
|
|
||||||
if (playing)
|
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;
|
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 < 10)
|
||||||
{
|
{
|
||||||
if (age < 0)
|
if (age < 0)
|
||||||
|
@ -115,7 +129,7 @@ void player()
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
std::cerr << "Dropping Chunk, age: " << age << "\n";
|
std::cerr << "Dropping Chunk, age: " << age << "\n";
|
||||||
}
|
*/ }
|
||||||
delete chunk;
|
delete chunk;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue