git-svn-id: svn://elaine/murooma/trunk@178 d8a302eb-03bc-478d-80e4-98257eca68ef
This commit is contained in:
(no author) 2014-08-11 06:43:46 +00:00
parent ea86198a12
commit 6c38b1eaa9
2 changed files with 7 additions and 3 deletions

View file

@ -1,6 +1,6 @@
VERSION = 0.01 VERSION = 0.01
CC = /usr/bin/g++ CC = /usr/bin/g++
CFLAGS = -std=gnu++0x -Wall -Wno-unused-function -g -O3 -D_REENTRANT -DVERSION=\"$(VERSION)\" -I.. CFLAGS = -std=gnu++0x -Wall -Wno-unused-function -O3 -D_REENTRANT -DVERSION=\"$(VERSION)\" -I..
LDFLAGS = -lrt -lpthread -lportaudio -lboost_system LDFLAGS = -lrt -lpthread -lportaudio -lboost_system
OBJ = snapClient.o stream.o ../common/chunk.o OBJ = snapClient.o stream.o ../common/chunk.o

View file

@ -140,7 +140,7 @@ void Stream::getPlayerChunk(short* outputBuffer, double outputBufferDacTime, uns
while (true)// (int i=0; i<(int)(round((float)sleep / (float)PLAYER_CHUNK_MS)) + 1; ++i) while (true)// (int i=0; i<(int)(round((float)sleep / (float)PLAYER_CHUNK_MS)) + 1; ++i)
{ {
int age = Chunk::getAge(getNextPlayerChunk(outputBuffer, framesPerBuffer)) - bufferMs + latencyMs; int age = Chunk::getAge(getNextPlayerChunk(outputBuffer, framesPerBuffer)) - bufferMs + latencyMs;
age += 4*cardBuffer; // age += 4*cardBuffer;
if (age < msBuffer / 2) if (age < msBuffer / 2)
break; break;
} }
@ -177,18 +177,22 @@ void Stream::getPlayerChunk(short* outputBuffer, double outputBufferDacTime, uns
{ {
if (pBuffer->full() && (abs(median) <= 10) && (abs(median) > 1)) if (pBuffer->full() && (abs(median) <= 10) && (abs(median) > 1))
{ {
cout << "pBuffer->full() && (abs(median) <= 10) && (abs(median) > 1): " << abs(median) << "\n";
sleep = median; sleep = median;
} }
else if (pShortBuffer->full() && (abs(shortMedian) <= 10) && (abs(shortMedian) > 5)) else if (pShortBuffer->full() && (abs(shortMedian) <= 10) && (abs(shortMedian) > 5))
{ {
cout << "pShortBuffer->full() && (abs(shortMedian) <= 10) && (abs(shortMedian) > 5): " << abs(shortMedian) << "\n";
sleep = shortMedian; sleep = shortMedian;
} }
if (pShortBuffer->full() && (abs(shortMedian) > 10)) if (pShortBuffer->full() && (abs(shortMedian) > 10))
{ {
cout << "pShortBuffer->full() && (abs(shortMedian) > 10): " << abs(shortMedian) << "\n";
sleep = shortMedian; sleep = shortMedian;
} }
else if (pMiniBuffer->full() && (abs(age) > 50) && (abs(pMiniBuffer->mean()) > 50)) else if (pMiniBuffer->full() && (abs(age) > 50) && (abs(pMiniBuffer->mean()) > 50))
{ {
cout << "pMiniBuffer->full() && (abs(age) > 50) && (abs(pMiniBuffer->mean()) > 50): " << abs(age) << "\n";
sleep = pMiniBuffer->mean(); sleep = pMiniBuffer->mean();
} }
} }
@ -208,7 +212,7 @@ void Stream::getPlayerChunk(short* outputBuffer, double outputBufferDacTime, uns
{ {
lastUpdate = now; lastUpdate = now;
median = pBuffer->median(); median = pBuffer->median();
shortMedian = pShortBuffer->median(); shortMedian = pShortBuffer->mean();
std::cerr << "Chunk: " << age << "\t" << pMiniBuffer->mean() << "\t" << shortMedian << "\t" << median << /*"\tmean: " << pBuffer->mean() <<*/ "\t" << pBuffer->size() << "\t" << cardBuffer << "\t" << outputBufferDacTime*1000 << "\n"; std::cerr << "Chunk: " << age << "\t" << pMiniBuffer->mean() << "\t" << shortMedian << "\t" << median << /*"\tmean: " << pBuffer->mean() <<*/ "\t" << pBuffer->size() << "\t" << cardBuffer << "\t" << outputBufferDacTime*1000 << "\n";
} }
} }