From 266553913f134755c021bf509cda55fb96a07e1a Mon Sep 17 00:00:00 2001 From: Ansariel Hiller Date: Sat, 27 Jul 2024 17:09:58 +0200 Subject: Fix running multiple viewer instances stealing sound from first instance (#2127) --- indra/llaudio/llaudiodecodemgr.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'indra/llaudio/llaudiodecodemgr.cpp') diff --git a/indra/llaudio/llaudiodecodemgr.cpp b/indra/llaudio/llaudiodecodemgr.cpp index a46f9acc63..d8a6fffea6 100755 --- a/indra/llaudio/llaudiodecodemgr.cpp +++ b/indra/llaudio/llaudiodecodemgr.cpp @@ -790,9 +790,12 @@ bool LLAudioDecodeMgr::addDecodeRequest(const LLUUID &uuid) if (gAssetStorage->hasLocalAsset(uuid, LLAssetType::AT_SOUND)) { - // Just put it on the decode queue. + // Just put it on the decode queue it if it's not already in the queue LL_DEBUGS("AudioEngine") << "addDecodeRequest for " << uuid << " has local asset file already" << LL_ENDL; - mImpl->mDecodeQueue.push_back(uuid); + if (std::find(mImpl->mDecodeQueue.begin(), mImpl->mDecodeQueue.end(), uuid) == mImpl->mDecodeQueue.end()) + { + mImpl->mDecodeQueue.emplace_back(uuid); + } return true; } -- cgit v1.2.3