diff options
author | Roxie Linden <roxie@lindenlab.com> | 2025-08-06 11:48:44 -0700 |
---|---|---|
committer | Roxie Linden <roxie@lindenlab.com> | 2025-08-08 14:37:46 -0700 |
commit | bab2c12d048e7faf021ee3a9df39251e91973abf (patch) | |
tree | b4d5928717a283b46f9a85c9489c1f31db3d1963 /indra/llwebrtc/llwebrtc.cpp | |
parent | 8ef660a7450dad60e5f73cd2cc50aeb6b9f8a356 (diff) |
Straighten out muting to prevent echo when crossing from vivox to webrtc regions.
Muting was a bit random in the code, so it's now been straightened out and should
prevent echo.
Also, code was added to not attempt connection to non-webrtc regions in the webrtc code.
Diffstat (limited to 'indra/llwebrtc/llwebrtc.cpp')
-rw-r--r-- | indra/llwebrtc/llwebrtc.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/indra/llwebrtc/llwebrtc.cpp b/indra/llwebrtc/llwebrtc.cpp index 28639b9af0..20951ff816 100644 --- a/indra/llwebrtc/llwebrtc.cpp +++ b/indra/llwebrtc/llwebrtc.cpp @@ -904,12 +904,12 @@ void LLWebRTCPeerConnectionImpl::enableSenderTracks(bool enable) // set_enabled shouldn't be done on the worker thread. if (mPeerConnection) { + mPeerConnection->SetAudioRecording(enable); auto senders = mPeerConnection->GetSenders(); for (auto &sender : senders) { sender->track()->set_enabled(enable); } - mPeerConnection->SetAudioRecording(enable); } } @@ -964,6 +964,9 @@ void LLWebRTCPeerConnectionImpl::setMute(bool mute) { if (mPeerConnection) { + // SetAudioRecording must be called before enabling/disabling tracks. + mPeerConnection->SetAudioRecording(enable); + auto senders = mPeerConnection->GetSenders(); RTC_LOG(LS_INFO) << __FUNCTION__ << (mMute ? "disabling" : "enabling") << " streams count " << senders.size(); @@ -982,7 +985,6 @@ void LLWebRTCPeerConnectionImpl::setMute(bool mute) track->set_enabled(enable); } } - mPeerConnection->SetAudioRecording(enable); } }); } |