From 6156baad67c744ed03ea47798bfeb8a77698efc6 Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Sun, 11 Jan 2009 16:10:10 -0600 Subject: Second Life viewer sources 1.22.4-RC --- linden/indra/llaudio/audioengine.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'linden/indra/llaudio') diff --git a/linden/indra/llaudio/audioengine.cpp b/linden/indra/llaudio/audioengine.cpp index 298ab1d..baea815 100644 --- a/linden/indra/llaudio/audioengine.cpp +++ b/linden/indra/llaudio/audioengine.cpp @@ -170,13 +170,6 @@ void LLAudioEngine::updateChannels() { if (mChannels[i]) { - // set secondary gain if type is available - LLAudioSource* source = mChannels[i]->getSource(); - if (source) - { - mChannels[i]->setSecondaryGain(mSecondaryGain[source->getType()]); - } - mChannels[i]->updateBuffer(); mChannels[i]->update3DPosition(); mChannels[i]->updateLoop(); @@ -1578,6 +1571,8 @@ void LLAudioChannel::setSource(LLAudioSource *sourcep) } mCurrentSourcep = sourcep; + + updateBuffer(); update3DPosition(); } @@ -1592,6 +1587,12 @@ BOOL LLAudioChannel::updateBuffer() return FALSE; } + // Initialize the channel's gain setting for this sound. + if(gAudiop) + { + setSecondaryGain(gAudiop->getSecondaryGain(mCurrentSourcep->getType())); + } + LLAudioBuffer *bufferp = mCurrentSourcep->getCurrentBuffer(); if (bufferp == mCurrentBufferp) { -- cgit v1.1