summaryrefslogtreecommitdiff
path: root/indra/llwebrtc
diff options
context:
space:
mode:
authorRoxie Linden <roxie@lindenlab.com>2023-12-01 01:28:38 -0800
committerRoxie Linden <roxie@lindenlab.com>2024-02-08 18:34:01 -0800
commitb10731f6f9f357907b7ba53d7531cfa3552c46cf (patch)
treee9fdf4453e6cd41e16a2211653a85c5c8f87a3f7 /indra/llwebrtc
parent7a6c7964520d185eefedfedc340b0cc07365ff88 (diff)
Setting volume for remote stream needs to happen in signaling thread
Diffstat (limited to 'indra/llwebrtc')
-rw-r--r--indra/llwebrtc/llwebrtc.cpp25
1 files changed, 14 insertions, 11 deletions
diff --git a/indra/llwebrtc/llwebrtc.cpp b/indra/llwebrtc/llwebrtc.cpp
index 4741ed92a3..2bcbb135c0 100644
--- a/indra/llwebrtc/llwebrtc.cpp
+++ b/indra/llwebrtc/llwebrtc.cpp
@@ -620,26 +620,29 @@ void LLWebRTCPeerConnectionImpl::setMute(bool mute)
void LLWebRTCPeerConnectionImpl::setReceiveVolume(float volume)
{
- auto receivers = mPeerConnection->GetReceivers();
-
- for (auto &receiver : receivers)
- {
- for (auto& stream : receiver->streams())
+ mWebRTCImpl->PostSignalingTask(
+ [this, volume]()
{
- for (auto& track : stream->GetAudioTracks())
+ auto receivers = mPeerConnection->GetReceivers();
+
+ for (auto &receiver : receivers)
{
- track->GetSource()->SetVolume(volume);
+ for (auto &stream : receiver->streams())
+ {
+ for (auto &track : stream->GetAudioTracks())
+ {
+ track->GetSource()->SetVolume(volume);
+ }
+ }
}
- }
- }
+ });
}
void LLWebRTCPeerConnectionImpl::setSendVolume(float volume)
{
if (mLocalStream)
{
- auto track = mLocalStream->FindAudioTrack("SLStream");
- if (track)
+ for (auto &track : mLocalStream->GetAudioTracks())
{
track->GetSource()->SetVolume(volume);
}