mirror of
https://github.com/badaix/snapcast.git
synced 2025-08-06 10:09:33 +02:00
report stream state
This commit is contained in:
parent
cd2daa2cf9
commit
94629f9909
9 changed files with 79 additions and 12 deletions
|
@ -76,7 +76,10 @@ void PipeReader::worker()
|
|||
{
|
||||
int count = read(fd_, chunk->payload + len, toRead - len);
|
||||
if (count < 0)
|
||||
{
|
||||
setState(kIdle);
|
||||
usleep(100*1000);
|
||||
}
|
||||
else if (count == 0)
|
||||
throw SnapException("end of file");
|
||||
else
|
||||
|
@ -92,6 +95,7 @@ void PipeReader::worker()
|
|||
if (nextTick >= currentTick)
|
||||
{
|
||||
// logO << "sleep: " << nextTick - currentTick << "\n";
|
||||
setState(kPlaying);
|
||||
usleep((nextTick - currentTick) * 1000);
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue