From b715396832e88536c0786d9ce92c167e17d02464 Mon Sep 17 00:00:00 2001 From: "(no author)" <(no author)@d8a302eb-03bc-478d-80e4-98257eca68ef> Date: Sun, 28 Sep 2014 09:15:56 +0000 Subject: [PATCH] dac out guard git-svn-id: svn://elaine/murooma/trunk@306 d8a302eb-03bc-478d-80e4-98257eca68ef --- client/stream.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/client/stream.cpp b/client/stream.cpp index 40babc74..e214378f 100644 --- a/client/stream.cpp +++ b/client/stream.cpp @@ -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()) { -// cout << "sleep > chunk->getDuration(): " << sleep.count() << " > " << chunk->duration().count() << ", chunks: " << chunks.size() << ", out: " << outputBufferDacTime.count() << ", needed: " << bufferDuration.count() << "\n"; + cout << "sleep > chunk->getDuration(): " << sleep.count() << " > " << chunk->duration().count() << ", chunks: " << chunks.size() << ", out: " << outputBufferDacTime.count() << ", needed: " << bufferDuration.count() << "\n"; if (!chunks.try_pop(chunk, outputBufferDacTime)) return false;