diff options
Diffstat (limited to 'indra/llaudio')
-rwxr-xr-x | indra/llaudio/llaudiodecodemgr.cpp | 61 | ||||
-rw-r--r-- | indra/llaudio/llaudioengine.cpp | 2 | ||||
-rwxr-xr-x | indra/llaudio/llaudioengine.h | 1 | ||||
-rw-r--r-- | indra/llaudio/llaudioengine_openal.h | 2 |
4 files changed, 32 insertions, 34 deletions
diff --git a/indra/llaudio/llaudiodecodemgr.cpp b/indra/llaudio/llaudiodecodemgr.cpp index 38a6b41afe..190c5290cb 100755 --- a/indra/llaudio/llaudiodecodemgr.cpp +++ b/indra/llaudio/llaudiodecodemgr.cpp @@ -607,40 +607,37 @@ void LLAudioDecodeMgr::Impl::startMoreDecodes() // Kick off a decode mDecodes[decode_id] = LLPointer<LLVorbisDecodeState>(NULL); - try - { - main_queue->postTo( - general_queue, - [decode_id]() // Work done on general queue - { - LLPointer<LLVorbisDecodeState> decode_state = beginDecodingAndWritingAudio(decode_id); - - if (!decode_state) - { - // Audio decode has errored - return decode_state; - } + bool posted = main_queue->postTo( + general_queue, + [decode_id]() // Work done on general queue + { + LLPointer<LLVorbisDecodeState> decode_state = beginDecodingAndWritingAudio(decode_id); - // Disk write of decoded audio is now in progress off-thread + if (!decode_state) + { + // Audio decode has errored return decode_state; - }, - [decode_id, this](LLPointer<LLVorbisDecodeState> decode_state) // Callback to main thread - mutable { - if (!gAudiop) - { - // There is no LLAudioEngine anymore. This might happen if - // an audio decode is enqueued just before shutdown. - return; - } - - // At this point, we can be certain that the pointer to "this" - // is valid because the lifetime of "this" is dependent upon - // the lifetime of gAudiop. - - enqueueFinishAudio(decode_id, decode_state); - }); - } - catch (const LLThreadSafeQueueInterrupt&) + } + + // Disk write of decoded audio is now in progress off-thread + return decode_state; + }, + [decode_id, this](LLPointer<LLVorbisDecodeState> decode_state) // Callback to main thread + mutable { + if (!gAudiop) + { + // There is no LLAudioEngine anymore. This might happen if + // an audio decode is enqueued just before shutdown. + return; + } + + // At this point, we can be certain that the pointer to "this" + // is valid because the lifetime of "this" is dependent upon + // the lifetime of gAudiop. + + enqueueFinishAudio(decode_id, decode_state); + }); + if (! posted) { // Shutdown // Consider making processQueue() do a cleanup instead diff --git a/indra/llaudio/llaudioengine.cpp b/indra/llaudio/llaudioengine.cpp index a387bb23cd..ece0a12a7a 100644 --- a/indra/llaudio/llaudioengine.cpp +++ b/indra/llaudio/llaudioengine.cpp @@ -398,7 +398,7 @@ void LLAudioEngine::idle() for (source_map::value_type& src_pair : mAllSources) { LLAudioSource *sourcep = src_pair.second; - if (sourcep->isMuted() && sourcep->isSyncMaster() && sourcep->getPriority() > max_sm_priority) + if (!sourcep->isMuted() && sourcep->isSyncMaster() && sourcep->getPriority() > max_sm_priority) { sync_masterp = sourcep; master_channelp = sync_masterp->getChannel(); diff --git a/indra/llaudio/llaudioengine.h b/indra/llaudio/llaudioengine.h index a133898969..c045d18c42 100755 --- a/indra/llaudio/llaudioengine.h +++ b/indra/llaudio/llaudioengine.h @@ -30,6 +30,7 @@ #include <list> #include <map> +#include <array> #include "v3math.h" #include "v3dmath.h" diff --git a/indra/llaudio/llaudioengine_openal.h b/indra/llaudio/llaudioengine_openal.h index a3cab97cd2..562c96c794 100644 --- a/indra/llaudio/llaudioengine_openal.h +++ b/indra/llaudio/llaudioengine_openal.h @@ -42,6 +42,7 @@ class LLAudioEngine_OpenAL : public LLAudioEngine virtual bool init(void *user_data, const std::string &app_title); virtual std::string getDriverName(bool verbose); + virtual LLStreamingAudioInterface* createDefaultStreamingAudioImpl() const { return nullptr; } virtual void allocateListener(); virtual void shutdown(); @@ -56,7 +57,6 @@ class LLAudioEngine_OpenAL : public LLAudioEngine /*virtual*/ void updateWind(LLVector3 direction, F32 camera_altitude); private: - void * windDSP(void *newbuffer, int length); typedef S16 WIND_SAMPLE_T; LLWindGen<WIND_SAMPLE_T> *mWindGen; S16 *mWindBuf; |