Merge branch 'master' of https://github.com/worklist/hifi into armstrong

This commit is contained in:
Andrzej Kapolka 2014-01-14 15:29:53 -08:00
commit eaf6aef1cb
2 changed files with 12 additions and 2 deletions

View file

@ -20,7 +20,8 @@ PositionalAudioRingBuffer::PositionalAudioRingBuffer(PositionalAudioRingBuffer::
_position(0.0f, 0.0f, 0.0f),
_orientation(0.0f, 0.0f, 0.0f, 0.0f),
_willBeAddedToMix(false),
_shouldLoopbackForNode(false)
_shouldLoopbackForNode(false),
_shouldOutputStarveDebug(true)
{
}
@ -57,11 +58,19 @@ int PositionalAudioRingBuffer::parsePositionalData(unsigned char* sourceBuffer,
bool PositionalAudioRingBuffer::shouldBeAddedToMix(int numJitterBufferSamples) {
if (!isNotStarvedOrHasMinimumSamples(NETWORK_BUFFER_LENGTH_SAMPLES_PER_CHANNEL + numJitterBufferSamples)) {
qDebug() << "Starved and do not have minimum samples to start. Buffer held back.\n";
if (_shouldOutputStarveDebug) {
qDebug() << "Starved and do not have minimum samples to start. Buffer held back.\n";
_shouldOutputStarveDebug = false;
}
return false;
} else if (samplesAvailable() < NETWORK_BUFFER_LENGTH_SAMPLES_PER_CHANNEL) {
qDebug() << "Do not have number of samples needed for interval. Buffer starved.\n";
_isStarved = true;
// reset our _shouldOutputStarveDebug to true so the next is printed
_shouldOutputStarveDebug = true;
return false;
} else {
// good buffer, add this to the mix

View file

@ -49,6 +49,7 @@ protected:
glm::quat _orientation;
bool _willBeAddedToMix;
bool _shouldLoopbackForNode;
bool _shouldOutputStarveDebug;
};
#endif /* defined(__hifi__PositionalAudioRingBuffer__) */