mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-28 00:16:17 +02:00
time stuff
git-svn-id: svn://elaine/murooma/trunk@301 d8a302eb-03bc-478d-80e4-98257eca68ef
This commit is contained in:
parent
1759aeb160
commit
a7118fd0a4
5 changed files with 53 additions and 45 deletions
|
@ -65,7 +65,7 @@ int main(int argc, char* argv[])
|
|||
|
||||
timeval tvChunk;
|
||||
gettimeofday(&tvChunk, NULL);
|
||||
long nextTick = getTickCount();
|
||||
long nextTick = chronos::getTickCount();
|
||||
|
||||
mkfifo(fifoName.c_str(), 0777);
|
||||
SampleFormat format(sampleFormat);
|
||||
|
@ -122,9 +122,9 @@ int main(int argc, char* argv[])
|
|||
controlServer->send(chunk);
|
||||
//cout << chunk->tv_sec << ", " << chunk->tv_usec / 1000 << "\n";
|
||||
// addUs(tvChunk, 1000*chunk->getDuration());
|
||||
addUs(tvChunk, chunkDuration * 1000);
|
||||
chronos::addUs(tvChunk, chunkDuration * 1000);
|
||||
nextTick += duration;
|
||||
long currentTick = getTickCount();
|
||||
long currentTick = chronos::getTickCount();
|
||||
if (nextTick > currentTick)
|
||||
{
|
||||
usleep((nextTick - currentTick) * 1000);
|
||||
|
@ -132,7 +132,7 @@ int main(int argc, char* argv[])
|
|||
else
|
||||
{
|
||||
gettimeofday(&tvChunk, NULL);
|
||||
nextTick = getTickCount();
|
||||
nextTick = chronos::getTickCount();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue