mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 19:56:44 +02:00
added _starveCount, _silentFramesDropped
This commit is contained in:
parent
df1b4107fd
commit
e732436783
2 changed files with 9 additions and 1 deletions
|
@ -100,7 +100,9 @@ PositionalAudioRingBuffer::PositionalAudioRingBuffer(PositionalAudioRingBuffer::
|
||||||
_desiredJitterBufferFrames(1),
|
_desiredJitterBufferFrames(1),
|
||||||
_currentJitterBufferFrames(-1),
|
_currentJitterBufferFrames(-1),
|
||||||
_dynamicJitterBuffers(dynamicJitterBuffers),
|
_dynamicJitterBuffers(dynamicJitterBuffers),
|
||||||
_consecutiveNotMixedCount(0)
|
_consecutiveNotMixedCount(0),
|
||||||
|
_starveCount(0),
|
||||||
|
_silentFramesDropped(0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -143,9 +145,12 @@ int PositionalAudioRingBuffer::parseData(const QByteArray& packet) {
|
||||||
addSilentFrame(numSilentFramesToAdd * samplesPerFrame);
|
addSilentFrame(numSilentFramesToAdd * samplesPerFrame);
|
||||||
_currentJitterBufferFrames = _desiredJitterBufferFrames;
|
_currentJitterBufferFrames = _desiredJitterBufferFrames;
|
||||||
|
|
||||||
|
_silentFramesDropped += numFramesToDropDesired;
|
||||||
} else {
|
} else {
|
||||||
// we need to drop all frames to get the jitter buffer close as possible to its desired length
|
// we need to drop all frames to get the jitter buffer close as possible to its desired length
|
||||||
_currentJitterBufferFrames -= numSilentFrames;
|
_currentJitterBufferFrames -= numSilentFrames;
|
||||||
|
|
||||||
|
_silentFramesDropped += numSilentFrames;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
addSilentFrame(numSilentSamples);
|
addSilentFrame(numSilentSamples);
|
||||||
|
@ -217,6 +222,7 @@ bool PositionalAudioRingBuffer::shouldBeAddedToMix() {
|
||||||
} else if (samplesAvailable() < samplesPerFrame) {
|
} else if (samplesAvailable() < samplesPerFrame) {
|
||||||
// if the buffer doesn't have a full frame of samples to take for mixing, it is starved
|
// if the buffer doesn't have a full frame of samples to take for mixing, it is starved
|
||||||
_isStarved = true;
|
_isStarved = true;
|
||||||
|
_starveCount++;
|
||||||
|
|
||||||
// set to -1 to indicate the jitter buffer is starved
|
// set to -1 to indicate the jitter buffer is starved
|
||||||
_currentJitterBufferFrames = -1;
|
_currentJitterBufferFrames = -1;
|
||||||
|
|
|
@ -110,6 +110,8 @@ protected:
|
||||||
|
|
||||||
// extra stats
|
// extra stats
|
||||||
int _consecutiveNotMixedCount;
|
int _consecutiveNotMixedCount;
|
||||||
|
int _starveCount;
|
||||||
|
int _silentFramesDropped;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // hifi_PositionalAudioRingBuffer_h
|
#endif // hifi_PositionalAudioRingBuffer_h
|
||||||
|
|
Loading…
Reference in a new issue