summaryrefslogtreecommitdiff
path: root/indra/llwebrtc
diff options
context:
space:
mode:
authorRoxie Linden <roxie@lindenlab.com>2024-02-06 19:12:14 -0800
committerRoxie Linden <roxie@lindenlab.com>2024-02-22 23:11:37 -0800
commit6f4ee11ae942d331fcf57db7466989f90bb55ccf (patch)
tree992c47b7710103a6e71824065cefe64fa6801648 /indra/llwebrtc
parent5a9f0488f458ade64e3a3f2388d5cd23092eed5d (diff)
race between session established and data channel ready
Diffstat (limited to 'indra/llwebrtc')
-rw-r--r--indra/llwebrtc/llwebrtc.cpp48
1 files changed, 15 insertions, 33 deletions
diff --git a/indra/llwebrtc/llwebrtc.cpp b/indra/llwebrtc/llwebrtc.cpp
index 06a5c3a085..ee85a254f2 100644
--- a/indra/llwebrtc/llwebrtc.cpp
+++ b/indra/llwebrtc/llwebrtc.cpp
@@ -476,40 +476,22 @@ void LLWebRTCImpl::OnDevicesUpdated()
void LLWebRTCImpl::setTuningMode(bool enable)
{
- mWorkerThread->BlockingCall(
- [this, enable]()
- {
- if (enable)
- {
-
- mTuningDeviceModule->StartRecording();
-
- if (mPeerDeviceModule)
- {
- mPeerDeviceModule->StopRecording();
- }
- }
- else
- {
- mTuningDeviceModule->StartRecording();
- if (mPeerDeviceModule)
- {
- mPeerDeviceModule->StartRecording();
- }
- }
- });
- for (auto& connection : mPeerConnections)
- {
- if (enable)
+ mSignalingThread->PostTask(
+ [this, enable]
{
- connection->enableSenderTracks(false);
- }
- else
- {
- connection->resetMute();
- }
- connection->enableReceiverTracks(!enable);
- }
+ for (auto &connection : mPeerConnections)
+ {
+ if (enable)
+ {
+ connection->enableSenderTracks(false);
+ }
+ else
+ {
+ connection->resetMute();
+ }
+ connection->enableReceiverTracks(!enable);
+ }
+ });
}
float LLWebRTCImpl::getTuningAudioLevel() { return -20 * log10f(mTuningAudioDeviceObserver->getMicrophoneEnergy()); }