mirror of
https://github.com/badaix/snapcast.git
synced 2025-07-17 16:37:46 +02:00
server timing
git-svn-id: svn://elaine/murooma/trunk@81 d8a302eb-03bc-478d-80e4-98257eca68ef
This commit is contained in:
parent
72dcc37d57
commit
f53709934b
1 changed files with 2 additions and 2 deletions
|
@ -35,8 +35,6 @@ int main () {
|
||||||
long nextTick = getTickCount();
|
long nextTick = getTickCount();
|
||||||
while (cin.good())
|
while (cin.good())
|
||||||
{
|
{
|
||||||
long currentTick = getTickCount();
|
|
||||||
nextTick += WIRE_CHUNK_MS;
|
|
||||||
for (size_t n=0; (n<WIRE_CHUNK_SIZE) && cin.good(); ++n)
|
for (size_t n=0; (n<WIRE_CHUNK_SIZE) && cin.good(); ++n)
|
||||||
{
|
{
|
||||||
c[0] = cin.get();
|
c[0] = cin.get();
|
||||||
|
@ -52,10 +50,12 @@ int main () {
|
||||||
publisher.send(message);
|
publisher.send(message);
|
||||||
addMs(now, WIRE_CHUNK_MS);
|
addMs(now, WIRE_CHUNK_MS);
|
||||||
|
|
||||||
|
long currentTick = getTickCount();
|
||||||
if (nextTick - currentTick > 0)
|
if (nextTick - currentTick > 0)
|
||||||
{
|
{
|
||||||
usleep((nextTick - currentTick) * 1000);
|
usleep((nextTick - currentTick) * 1000);
|
||||||
}
|
}
|
||||||
|
nextTick += WIRE_CHUNK_MS;
|
||||||
}
|
}
|
||||||
delete chunk;
|
delete chunk;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue