mirror of
https://github.com/badaix/snapcast.git
synced 2025-07-09 20:57:43 +02:00
portable sleep function
This commit is contained in:
parent
17879618c7
commit
951548f412
12 changed files with 35 additions and 19 deletions
|
@ -90,7 +90,7 @@ void PipeStream::worker()
|
|||
if (count < 0)
|
||||
{
|
||||
setState(kIdle);
|
||||
usleep(100*1000);
|
||||
chronos::sleep(100);
|
||||
}
|
||||
else if (count == 0)
|
||||
throw SnapException("end of file");
|
||||
|
@ -108,7 +108,7 @@ void PipeStream::worker()
|
|||
{
|
||||
// logO << "sleep: " << nextTick - currentTick << "\n";
|
||||
setState(kPlaying);
|
||||
usleep((nextTick - currentTick) * 1000);
|
||||
chronos::sleep(nextTick - currentTick);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -122,7 +122,7 @@ void PipeStream::worker()
|
|||
catch(const std::exception& e)
|
||||
{
|
||||
logE << "Exception: " << e.what() << std::endl;
|
||||
usleep(100*1000);
|
||||
chronos::sleep(100);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue