From 3fe17b6bbdbb6cdbe811e43f72394e2f6ba482cd Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Thu, 2 Sep 2010 13:05:34 -0700 Subject: Applied patch by Damian Delacrois for VWR-10592: sounds not working when running multiple instances --- linden/indra/llaudio/audioengine.cpp | 3 +++ linden/indra/llaudio/audioengine_openal.cpp | 2 +- linden/indra/llaudio/llaudiodecodemgr.cpp | 7 +++++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/linden/indra/llaudio/audioengine.cpp b/linden/indra/llaudio/audioengine.cpp index 7cec920..728f054 100644 --- a/linden/indra/llaudio/audioengine.cpp +++ b/linden/indra/llaudio/audioengine.cpp @@ -1892,6 +1892,9 @@ bool LLAudioData::load() gAudiop->cleanupBuffer(mBufferp); mBufferp = NULL; + // Maybe it was removed by another instance. Send it to the preload queue. + gAudiop->preloadSound(mID); + return false; } mBufferp->mAudioDatap = this; diff --git a/linden/indra/llaudio/audioengine_openal.cpp b/linden/indra/llaudio/audioengine_openal.cpp index b4eed57..84305f0 100644 --- a/linden/indra/llaudio/audioengine_openal.cpp +++ b/linden/indra/llaudio/audioengine_openal.cpp @@ -109,7 +109,7 @@ bool LLAudioEngine_OpenAL::init(const S32 num_channels, void* userdata) ALCdevice *device = alcGetContextsDevice(alcGetCurrentContext()); alcGetIntegerv(device, ALC_MAJOR_VERSION, 1, &major); - alcGetIntegerv(device, ALC_MAJOR_VERSION, 1, &minor); + alcGetIntegerv(device, ALC_MINOR_VERSION, 1, &minor); llinfos << "ALC version: " << major << "." << minor << llendl; llinfos << "ALC default device: " diff --git a/linden/indra/llaudio/llaudiodecodemgr.cpp b/linden/indra/llaudio/llaudiodecodemgr.cpp index 399adf5..afb3c33 100644 --- a/linden/indra/llaudio/llaudiodecodemgr.cpp +++ b/linden/indra/llaudio/llaudiodecodemgr.cpp @@ -631,8 +631,11 @@ BOOL LLAudioDecodeMgr::addDecodeRequest(const LLUUID &uuid) if (gAssetStorage->hasLocalAsset(uuid, LLAssetType::AT_SOUND)) { - // Just put it on the decode queue. - mImpl->mDecodeQueue.push(uuid); + // Just put it on the decode queue if it's not already. + if (!mImpl->mDecodeQueue.checkData(uuid)) + { + mImpl->mDecodeQueue.push(uuid); + } return TRUE; } -- cgit v1.1