summaryrefslogtreecommitdiff
path: root/indra/llaudio
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2023-11-29 10:45:43 +0200
committerAndrey Lihatskiy <alihatskiy@productengine.com>2023-11-29 10:45:43 +0200
commitd1c0a5b840e9ec2d3a468216339ae5367aed4bf5 (patch)
tree30a47a8bf5ba4561c0f6d3839afd1a9f35dac873 /indra/llaudio
parent6f99a844efe4e7809ed0a995b0118851e6f0d8d5 (diff)
parent53e958a2638705572ed7dbf61369d92b332c4b60 (diff)
Merge branch 'DRTVWR-559' into marchcat/587-v-pbr-merge
# Conflicts: # indra/llcommon/CMakeLists.txt # indra/newview/llspatialpartition.cpp # indra/newview/llviewergenericmessage.cpp # indra/newview/llvoavatar.cpp
Diffstat (limited to 'indra/llaudio')
-rwxr-xr-xindra/llaudio/llaudiodecodemgr.cpp61
1 files changed, 29 insertions, 32 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