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-08 18:37:09 -0800
commit90efc71ef9f0fa43d6b3b8d2ebc8bda1556b669f (patch)
treef1f1894c537c1a5dcc4ef4de622b11ee28f7cb06 /indra/llwebrtc
parent49a1b4038f4852df17f574f1fb5b01c5b5ddafb4 (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()); }