From f14da991e1ede141e9e524838e81bf4aeeaa00d3 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Sat, 11 Apr 2015 11:18:01 +0200 Subject: [PATCH] FIRE-480: Opening multiple instances causes sound failures; Based on a patch by Jules Joffe contributed to https://jira.secondlife.com/browse/VWR-10592 but heavily modified to make it really work --- indra/llaudio/llaudiodecodemgr.cpp | 9 ++++++++- indra/llaudio/llaudioengine.cpp | 11 +++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/indra/llaudio/llaudiodecodemgr.cpp b/indra/llaudio/llaudiodecodemgr.cpp index c37a0893c6..515c174e01 100755 --- a/indra/llaudio/llaudiodecodemgr.cpp +++ b/indra/llaudio/llaudiodecodemgr.cpp @@ -699,7 +699,14 @@ BOOL LLAudioDecodeMgr::addDecodeRequest(const LLUUID &uuid) { // Just put it on the decode queue. LL_DEBUGS("AudioEngine") << "addDecodeRequest for " << uuid << " has local asset file already" << LL_ENDL; - mImpl->mDecodeQueue.push_back(uuid); + // FIRE-480: Opening multiple instances causes sound failures + //mImpl->mDecodeQueue.push_back(uuid); + // ...only add it if it's note already in the queue + if (std::find(mImpl->mDecodeQueue.begin(), mImpl->mDecodeQueue.end(), uuid) == mImpl->mDecodeQueue.end()) + { + mImpl->mDecodeQueue.push_back(uuid); + } + // return TRUE; } diff --git a/indra/llaudio/llaudioengine.cpp b/indra/llaudio/llaudioengine.cpp index 1a5c0f1521..e37463337b 100755 --- a/indra/llaudio/llaudioengine.cpp +++ b/indra/llaudio/llaudioengine.cpp @@ -1961,6 +1961,17 @@ bool LLAudioData::load() gAudiop->cleanupBuffer(mBufferp); mBufferp = NULL; + // FIRE-480: Opening multiple instances causes sound failures + if (!gDirUtilp->fileExists(wav_path)) + { + mHasLocalData = false; + mHasDecodedData = false; + mHasCompletedDecode = false; + mHasValidData = true; + gAudiop->preloadSound(mID); + } + // + return false; } mBufferp->mAudioDatap = this;