diff options
author | Roxie Linden <roxie@lindenlab.com> | 2023-12-01 01:28:38 -0800 |
---|---|---|
committer | Roxie Linden <roxie@lindenlab.com> | 2024-02-22 23:11:35 -0800 |
commit | e5a95a96bface28bbd37afe655209d04f03cd250 (patch) | |
tree | 897c22ef1d6d6b4a32e93ebca5509f80472e7518 /indra | |
parent | 0b9c27dc70255385fd65ac2f1f8f99e2e013ea03 (diff) |
Setting volume for remote stream needs to happen in signaling thread
Diffstat (limited to 'indra')
-rw-r--r-- | indra/llwebrtc/llwebrtc.cpp | 25 |
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); } |