mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-25 15:06:21 +02:00
buffer
git-svn-id: svn://elaine/murooma/trunk@18 d8a302eb-03bc-478d-80e4-98257eca68ef
This commit is contained in:
parent
19bd1961d4
commit
23ae9c1327
1 changed files with 10 additions and 2 deletions
12
client.cpp
12
client.cpp
|
@ -90,15 +90,23 @@ void player()
|
||||||
|
|
||||||
// playing = playing || (getAge(*chunks.front()) > 200);
|
// playing = playing || (getAge(*chunks.front()) > 200);
|
||||||
|
|
||||||
std::cerr << "Chunk: " << getAge(*chunk) << "\n";
|
|
||||||
if (playing)
|
if (playing)
|
||||||
{
|
{
|
||||||
|
int age = getAge(*chunk) - 300;
|
||||||
|
while (age < 0)
|
||||||
|
{
|
||||||
|
usleep((-age) * 1000/ 2);
|
||||||
|
age = getAge(*chunk) - 300;
|
||||||
|
}
|
||||||
|
std::cerr << "Playing: " << getAge(*chunk) << "\n";
|
||||||
|
|
||||||
for (size_t n=0; n<size; ++n)
|
for (size_t n=0; n<size; ++n)
|
||||||
{
|
{
|
||||||
std::cout << chunk->payload[n] << std::flush;
|
std::cout << chunk->payload[n];// << std::flush;
|
||||||
// if (size % 100 == 0)
|
// if (size % 100 == 0)
|
||||||
// std::cout << std::flush;
|
// std::cout << std::flush;
|
||||||
}
|
}
|
||||||
|
std::cout << std::flush;
|
||||||
}
|
}
|
||||||
delete chunk;
|
delete chunk;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue