diff options
author | Roxie Linden <roxie@lindenlab.com> | 2024-03-14 20:04:39 -0700 |
---|---|---|
committer | Roxie Linden <roxie@lindenlab.com> | 2024-03-14 20:04:39 -0700 |
commit | dbbbbc55af5c1b5e81e7a493a9b5fe5718f15c07 (patch) | |
tree | 5ebe56c1b899ce0768dd2c7320fcb7e579ec7ec8 /indra/newview/llvoicewebrtc.cpp | |
parent | ef8a3833eb481d2174a13c12fa13044a65d8be5f (diff) |
Refactor device selection logic
This refactor fixed a few bugs. There is an annoying 'click' when
changing devices, however. This will be addressed in the future.
Diffstat (limited to 'indra/newview/llvoicewebrtc.cpp')
-rw-r--r-- | indra/newview/llvoicewebrtc.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/indra/newview/llvoicewebrtc.cpp b/indra/newview/llvoicewebrtc.cpp index d3ea02633f..7be02c1e21 100644 --- a/indra/newview/llvoicewebrtc.cpp +++ b/indra/newview/llvoicewebrtc.cpp @@ -591,14 +591,15 @@ void LLWebRTCVoiceClient::OnDevicesChanged(const llwebrtc::LLWebRTCVoiceDeviceLi std::string inputDevice = gSavedSettings.getString("VoiceInputAudioDevice"); std::string outputDevice = gSavedSettings.getString("VoiceOutputAudioDevice"); + LL_DEBUGS("Voice") << "Setting devices to-input: '" << inputDevice << "' output: '" << outputDevice << "'" << LL_ENDL; clearRenderDevices(); bool renderDeviceSet = false; for (auto &device : render_devices) { addRenderDevice(LLVoiceDevice(device.mDisplayName, device.mID)); - if (device.mCurrent && outputDevice == device.mID) + LL_DEBUGS("Voice") << "Checking render device" << "'" << device.mID << "'" << LL_ENDL; + if (outputDevice == device.mID) { - setRenderDevice(outputDevice); renderDeviceSet = true; } } @@ -611,10 +612,11 @@ void LLWebRTCVoiceClient::OnDevicesChanged(const llwebrtc::LLWebRTCVoiceDeviceLi bool captureDeviceSet = false; for (auto &device : capture_devices) { + LL_DEBUGS("Voice") << "Checking capture device:'" << device.mID << "'" << LL_ENDL; + addCaptureDevice(LLVoiceDevice(device.mDisplayName, device.mID)); - if (device.mCurrent && inputDevice == device.mID) + if (inputDevice == device.mID) { - setCaptureDevice(outputDevice); captureDeviceSet = true; } } @@ -2410,7 +2412,7 @@ bool LLVoiceWebRTCSpatialConnection::requestVoiceConnection() { body["parcel_local_id"] = mParcelLocalID; } - + body["channel_type"] = "local"; body["voice_server_type"] = WEBRTC_VOICE_SERVER_TYPE; LLCoreHttpUtil::HttpCoroutineAdapter::callbackHttpPost( |