mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-10 07:36:41 +02:00
dac out guard
git-svn-id: svn://elaine/murooma/trunk@306 d8a302eb-03bc-478d-80e4-98257eca68ef
This commit is contained in:
parent
29bcbe43b0
commit
b715396832
1 changed files with 4 additions and 1 deletions
|
@ -157,6 +157,9 @@ void Stream::resetBuffers()
|
|||
|
||||
bool Stream::getPlayerChunk(void* outputBuffer, const chronos::usec& outputBufferDacTime, unsigned long framesPerBuffer)
|
||||
{
|
||||
if (outputBufferDacTime > bufferMs)
|
||||
return false;
|
||||
|
||||
if (!chunk && !chunks.try_pop(chunk, outputBufferDacTime))
|
||||
return false;
|
||||
|
||||
|
@ -191,7 +194,7 @@ bool Stream::getPlayerChunk(void* outputBuffer, const chronos::usec& outputBuffe
|
|||
// We're late: discard oldest chunks
|
||||
while (sleep > chunk->duration<chronos::usec>())
|
||||
{
|
||||
// cout << "sleep > chunk->getDuration(): " << sleep.count() << " > " << chunk->duration<chronos::msec>().count() << ", chunks: " << chunks.size() << ", out: " << outputBufferDacTime.count() << ", needed: " << bufferDuration.count() << "\n";
|
||||
cout << "sleep > chunk->getDuration(): " << sleep.count() << " > " << chunk->duration<chronos::msec>().count() << ", chunks: " << chunks.size() << ", out: " << outputBufferDacTime.count() << ", needed: " << bufferDuration.count() << "\n";
|
||||
if (!chunks.try_pop(chunk, outputBufferDacTime))
|
||||
return false;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue