mirror of
https://github.com/badaix/snapcast.git
synced 2025-06-01 18:31:45 +02:00
cleanup
git-svn-id: svn://elaine/murooma/trunk@147 d8a302eb-03bc-478d-80e4-98257eca68ef
This commit is contained in:
parent
a499f6561d
commit
72f2afcf24
2 changed files with 6 additions and 20 deletions
21
stream.cpp
21
stream.cpp
|
@ -24,19 +24,7 @@ void Stream::setBufferLen(size_t bufferLenMs)
|
|||
|
||||
void Stream::addChunk(Chunk* chunk)
|
||||
{
|
||||
// Chunk* c = new Chunk(*chunk);
|
||||
// mutex.lock();
|
||||
chunks.push(shared_ptr<Chunk>(chunk));
|
||||
// mutex.unlock();
|
||||
}
|
||||
|
||||
|
||||
|
||||
shared_ptr<Chunk> Stream::getNextChunk()
|
||||
{
|
||||
if (!chunk)
|
||||
chunk = chunks.pop();
|
||||
return chunk;
|
||||
}
|
||||
|
||||
|
||||
|
@ -50,7 +38,9 @@ void Stream::getSilentPlayerChunk(short* outputBuffer)
|
|||
|
||||
time_point_ms Stream::getNextPlayerChunk(short* outputBuffer, int correction)
|
||||
{
|
||||
chunk = getNextChunk();
|
||||
if (!chunk)
|
||||
chunk = chunks.pop();
|
||||
|
||||
time_point_ms tp = chunk->timePoint();
|
||||
int read = 0;
|
||||
int toRead = PLAYER_CHUNK_SIZE + correction*PLAYER_CHUNK_MS_SIZE;
|
||||
|
@ -65,10 +55,7 @@ time_point_ms Stream::getNextPlayerChunk(short* outputBuffer, int correction)
|
|||
{
|
||||
read += chunk->read(buffer + read, toRead - read);
|
||||
if (chunk->isEndOfChunk())
|
||||
{
|
||||
chunk = NULL;
|
||||
chunk = getNextChunk();
|
||||
}
|
||||
chunk = chunks.pop();
|
||||
}
|
||||
|
||||
if (correction != 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue