removed Audio.cpp initialization list warning; updated Injector removal conditions

This commit is contained in:
wangyix 2014-07-11 15:07:50 -07:00
parent 3a98ea0d56
commit 90c931ea45
3 changed files with 5 additions and 6 deletions

View file

@ -394,7 +394,7 @@ void AudioMixer::prepareMixForListeningNode(Node* node) {
addBufferToMixForListeningNodeWithBuffer(otherNodeBuffer, nodeRingBuffer);
} else {
//if (debug) {
if (debug) {
printf("\nWILL NOT MIX!!!\n");
printf("listening node = %s\n", node->getUUID().toString().toLatin1().data());
printf("other node = %s\n", otherNode->getUUID().toString().toLatin1().data());
@ -409,7 +409,7 @@ void AudioMixer::prepareMixForListeningNode(Node* node) {
printf("\t\t other==listening || shouldLoopBack: %d\n", (*otherNode != *node || otherNodeBuffer->shouldLoopbackForNode()));
printf("\t\t other will be added to mix: %d\n", otherNodeBuffer->willBeAddedToMix());
printf("\t\t other trailing loudess: %f\n", otherNodeBuffer->getNextOutputTrailingLoudness());
//}
}
}
}
}

View file

@ -154,13 +154,12 @@ void AudioMixerClientData::pushBuffersAfterFrameSend() {
// this was a used buffer, push the output pointer forwards
PositionalAudioRingBuffer* audioBuffer = *i;
const int INJECTOR_CONSECUTIVE_NOT_MIXED_THRESHOLD = 100;
const int INJECTOR_CONSECUTIVE_NOT_MIXED_THRESHOLD = 200;
if (audioBuffer->willBeAddedToMix()) {
audioBuffer->shiftReadPosition(audioBuffer->getSamplesPerFrame());
audioBuffer->setWillBeAddedToMix(false);
} else if (audioBuffer->getType() == PositionalAudioRingBuffer::Injector
&& audioBuffer->hasStarted() && audioBuffer->isStarved()
&& audioBuffer->getConsecutiveNotMixedCount() > INJECTOR_CONSECUTIVE_NOT_MIXED_THRESHOLD) {
// this is an empty audio buffer that has starved, safe to delete
// also delete its sequence number stats

View file

@ -115,9 +115,9 @@ Audio::Audio(int16_t initialJitterBufferSamples, QObject* parent) :
_audioMixerAvatarStreamAudioStats(),
_outgoingAvatarAudioSequenceNumber(0),
_incomingMixedAudioSequenceNumberStats(INCOMING_SEQ_STATS_HISTORY_LENGTH),
_interframeTimeGapStats(TIME_GAPS_STATS_INTERVAL_SAMPLES, TIME_GAP_STATS_WINDOW_INTERVALS),
_starveCount(0),
_consecutiveNotMixedCount(0)
_consecutiveNotMixedCount(0),
_interframeTimeGapStats(TIME_GAPS_STATS_INTERVAL_SAMPLES, TIME_GAP_STATS_WINDOW_INTERVALS)
{
// clear the array of locally injected samples
memset(_localProceduralSamples, 0, NETWORK_BUFFER_LENGTH_BYTES_PER_CHANNEL);