mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-11 16:16:42 +02:00
reset sleep timer
This commit is contained in:
parent
82f7876da2
commit
84cdd5b8ff
1 changed files with 11 additions and 1 deletions
|
@ -173,10 +173,18 @@ void Stream::resetBuffers()
|
||||||
bool Stream::getPlayerChunk(void* outputBuffer, const chronos::usec& outputBufferDacTime, unsigned long framesPerBuffer)
|
bool Stream::getPlayerChunk(void* outputBuffer, const chronos::usec& outputBufferDacTime, unsigned long framesPerBuffer)
|
||||||
{
|
{
|
||||||
if (outputBufferDacTime > bufferMs_)
|
if (outputBufferDacTime > bufferMs_)
|
||||||
|
{
|
||||||
|
logO << "outputBufferDacTime > bufferMs: " << outputBufferDacTime.count() << " > " << std::chrono::duration_cast<usec>(bufferMs_).count() << "\n";
|
||||||
|
sleep_ = chronos::usec(0);
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (!chunk_ && !chunks_.try_pop(chunk_, outputBufferDacTime))
|
if (!chunk_ && !chunks_.try_pop(chunk_, outputBufferDacTime))
|
||||||
|
{
|
||||||
|
logO << "!chunk_ && !chunks_.try_pop(chunk_, outputBufferDacTime)\n";
|
||||||
|
sleep_ = chronos::usec(0);
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
playedFrames_ += framesPerBuffer;
|
playedFrames_ += framesPerBuffer;
|
||||||
|
|
||||||
|
@ -290,7 +298,9 @@ bool Stream::getPlayerChunk(void* outputBuffer, const chronos::usec& outputBuffe
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sleep_.count() != 0)
|
if (sleep_.count() != 0)
|
||||||
logO << "Sleep: " << sleep_.count() << "\n";
|
{
|
||||||
|
logO << "Sleep " << sleep_.count() << ", age: " << age.count() << ", bufferDuration: " << std::chrono::duration_cast<usec>(bufferDuration).count() << "\n";
|
||||||
|
}
|
||||||
else if (shortBuffer_.full())
|
else if (shortBuffer_.full())
|
||||||
{
|
{
|
||||||
if (chronos::usec(shortMedian_) > chronos::usec(100))
|
if (chronos::usec(shortMedian_) > chronos::usec(100))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue