mirror of
https://github.com/lubosz/overte.git
synced 2025-04-23 01:04:06 +02:00
removed debug code
This commit is contained in:
parent
5fd1d0a87c
commit
e1d28dfe73
4 changed files with 4 additions and 21 deletions
|
@ -342,8 +342,7 @@ void Stats::display(
|
|||
verticalOffset = 0;
|
||||
horizontalOffset = _lastHorizontalOffset + _generalStatsWidth + _pingStatsWidth + 2;
|
||||
}
|
||||
|
||||
|
||||
|
||||
MyAvatar* myAvatar = Application::getInstance()->getAvatar();
|
||||
glm::vec3 avatarPos = myAvatar->getPosition();
|
||||
|
||||
|
|
|
@ -128,14 +128,6 @@ qint64 AudioRingBuffer::writeData(const char* data, qint64 maxSize) {
|
|||
// otherwise we should not copy that data, and leave the buffer pointers where they are
|
||||
|
||||
int samplesToCopy = std::min((quint64)(maxSize / sizeof(int16_t)), (quint64)_sampleCapacity);
|
||||
/*
|
||||
if (_hasStarted && samplesToCopy > _sampleCapacity - samplesAvailable()) {
|
||||
// this write would overflow the buffer, so call us starved and reset the buffer
|
||||
qDebug() << "Overflowed the ring buffer. Resetting.";
|
||||
_endOfLastWrite = _buffer;
|
||||
_nextOutput = _buffer;
|
||||
_isStarved = true;
|
||||
}*/
|
||||
|
||||
int samplesRoomFor = _sampleCapacity - samplesAvailable();
|
||||
if (samplesToCopy > samplesRoomFor) {
|
||||
|
@ -143,7 +135,6 @@ qint64 AudioRingBuffer::writeData(const char* data, qint64 maxSize) {
|
|||
int samplesToDelete = samplesToCopy - samplesRoomFor;
|
||||
_nextOutput = shiftedPositionAccomodatingWrap(_nextOutput, samplesToDelete);
|
||||
qDebug() << "Overflowed ring buffer! Overwriting old data";
|
||||
printf("_nextOutput at index %d\n", _nextOutput - _buffer);
|
||||
}
|
||||
|
||||
if (_endOfLastWrite + samplesToCopy <= _buffer + _arrayLength) {
|
||||
|
@ -169,8 +160,6 @@ const int16_t& AudioRingBuffer::operator[] (const int index) const {
|
|||
|
||||
void AudioRingBuffer::shiftReadPosition(unsigned int numSamples) {
|
||||
_nextOutput = shiftedPositionAccomodatingWrap(_nextOutput, numSamples);
|
||||
printf("\n<<< mixed! %d samples remaining\n", samplesAvailable());
|
||||
printf("_nextOutput at index %d\n", _nextOutput - _buffer);
|
||||
}
|
||||
|
||||
unsigned int AudioRingBuffer::samplesAvailable() const {
|
||||
|
@ -194,7 +183,6 @@ int AudioRingBuffer::addSilentFrame(int numSilentSamples) {
|
|||
// there's not enough room for this write. write as many silent samples as we have room for
|
||||
numSilentSamples = samplesRoomFor;
|
||||
qDebug() << "Dropping some silent samples to prevent ring buffer overflow";
|
||||
printf("_nextOutput at index %d\n", _nextOutput - _buffer);
|
||||
}
|
||||
|
||||
// memset zeroes into the buffer, accomodate a wrap around the end
|
||||
|
|
|
@ -148,8 +148,6 @@ int PositionalAudioRingBuffer::parseData(const QByteArray& packet) {
|
|||
// there is audio data to read
|
||||
readBytes += writeData(packet.data() + readBytes, packet.size() - readBytes);
|
||||
}
|
||||
printf("\n >>> parse data. %d samples available\n", samplesAvailable());
|
||||
printf("_endOfLastWrite at index %d\n", _endOfLastWrite - _buffer);
|
||||
return readBytes;
|
||||
}
|
||||
|
||||
|
@ -202,7 +200,6 @@ bool PositionalAudioRingBuffer::shouldBeAddedToMix() {
|
|||
if (!isNotStarvedOrHasMinimumSamples(samplesPerFrame + desiredJitterBufferSamples)) {
|
||||
// if the buffer was starved, allow it to accrue at least the desired number of
|
||||
// jitter buffer frames before we start taking frames from it for mixing
|
||||
printf("NOT MIXED! waiting to refill after starve\n");
|
||||
if (_shouldOutputStarveDebug) {
|
||||
_shouldOutputStarveDebug = false;
|
||||
}
|
||||
|
@ -211,7 +208,7 @@ printf("NOT MIXED! waiting to refill after starve\n");
|
|||
} else if (samplesAvailable() < samplesPerFrame) {
|
||||
// if the buffer doesn't have a full frame of samples to take for mixing, it is starved
|
||||
_isStarved = true;
|
||||
printf("NOT MIXED! buffer is now starved\n");
|
||||
|
||||
// set to 0 to indicate the jitter buffer is starved
|
||||
_currentJitterBufferFrames = 0;
|
||||
|
||||
|
@ -227,7 +224,6 @@ printf("NOT MIXED! buffer is now starved\n");
|
|||
// minus one (since a frame will be read immediately after this) is the length of the jitter buffer
|
||||
_currentJitterBufferFrames = samplesAvailable() / samplesPerFrame - 1;
|
||||
_isStarved = false;
|
||||
printf("buffer has been refilled. current jbuffer frames: %d\n", _currentJitterBufferFrames);
|
||||
}
|
||||
|
||||
// since we've read data from ring buffer at least once - we've started
|
||||
|
|
|
@ -76,9 +76,9 @@ public:
|
|||
void setListenerUnattenuatedZone(AABox* listenerUnattenuatedZone) { _listenerUnattenuatedZone = listenerUnattenuatedZone; }
|
||||
|
||||
int getSamplesPerFrame() const { return _isStereo ? NETWORK_BUFFER_LENGTH_SAMPLES_STEREO : NETWORK_BUFFER_LENGTH_SAMPLES_PER_CHANNEL; }
|
||||
int getCurrentJitterBufferFrames() const { return _currentJitterBufferFrames; }
|
||||
|
||||
|
||||
int getDesiredJitterBufferFrames() const { return _desiredJitterBufferFrames; }
|
||||
int getCurrentJitterBufferFrames() const { return _currentJitterBufferFrames; }
|
||||
|
||||
protected:
|
||||
// disallow copying of PositionalAudioRingBuffer objects
|
||||
|
|
Loading…
Reference in a new issue