diff options
author | Roxie Linden <roxie@lindenlab.com> | 2023-12-08 12:09:02 -0800 |
---|---|---|
committer | Roxie Linden <roxie@lindenlab.com> | 2024-02-08 18:34:02 -0800 |
commit | e3b719f41e20ea3261e66283d1c9281bb8e6f320 (patch) | |
tree | dc4deca5c3acbd79a5c963daa63f499519a4c1b1 /indra/llwebrtc | |
parent | 1b2b5d2de9da01725898d25fea93925a82024ad4 (diff) |
fix device selection (hopefully)
Diffstat (limited to 'indra/llwebrtc')
-rw-r--r-- | indra/llwebrtc/llwebrtc.cpp | 17 | ||||
-rw-r--r-- | indra/llwebrtc/llwebrtc_impl.h | 1 |
2 files changed, 16 insertions, 2 deletions
diff --git a/indra/llwebrtc/llwebrtc.cpp b/indra/llwebrtc/llwebrtc.cpp index 32a75d3675..12997e34d3 100644 --- a/indra/llwebrtc/llwebrtc.cpp +++ b/indra/llwebrtc/llwebrtc.cpp @@ -300,10 +300,10 @@ void LLWebRTCImpl::setRenderDevice(const std::string &id) { mTuningDeviceModule->StartPlayout(); } - renderDeviceCount = mPeerDeviceModule->PlayoutDevices(); if (mPeerDeviceModule) { + renderDeviceCount = mPeerDeviceModule->PlayoutDevices(); for (int16_t i = 0; i < renderDeviceCount; i++) { char name[webrtc::kAdmMaxDeviceNameSize]; @@ -317,6 +317,7 @@ void LLWebRTCImpl::setRenderDevice(const std::string &id) break; } } + mPeerDeviceModule->StopPlayout(); mPeerDeviceModule->SetPlayoutDevice(mPlayoutDevice); mPeerDeviceModule->InitSpeaker(); mPeerDeviceModule->InitPlayout(); @@ -379,7 +380,14 @@ void LLWebRTCImpl::setTuningMode(bool enable) }); for (auto& connection : mPeerConnections) { - connection->enableSenderTracks(enable ? false : !mMute); + if (enable) + { + connection->enableSenderTracks(false); + } + else + { + connection->resetMute(); + } connection->enableReceiverTracks(!enable); } } @@ -620,6 +628,11 @@ void LLWebRTCPeerConnectionImpl::setMute(bool mute) } } +void LLWebRTCPeerConnectionImpl::resetMute() +{ + setMute(mMute); +} + void LLWebRTCPeerConnectionImpl::setReceiveVolume(float volume) { mWebRTCImpl->PostSignalingTask( diff --git a/indra/llwebrtc/llwebrtc_impl.h b/indra/llwebrtc/llwebrtc_impl.h index cc22c30f35..6a84f67ef5 100644 --- a/indra/llwebrtc/llwebrtc_impl.h +++ b/indra/llwebrtc/llwebrtc_impl.h @@ -273,6 +273,7 @@ class LLWebRTCPeerConnectionImpl : public LLWebRTCPeerConnection, void OnMessage(const webrtc::DataBuffer& buffer) override; // Helpers + void resetMute(); void enableSenderTracks(bool enable); void enableReceiverTracks(bool enable); |