summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorRoxie Linden <roxie@lindenlab.com>2024-03-14 20:04:39 -0700
committerRoxie Linden <roxie@lindenlab.com>2024-03-14 20:04:39 -0700
commitdbbbbc55af5c1b5e81e7a493a9b5fe5718f15c07 (patch)
tree5ebe56c1b899ce0768dd2c7320fcb7e579ec7ec8 /indra/newview
parentef8a3833eb481d2174a13c12fa13044a65d8be5f (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')
-rw-r--r--indra/newview/llvoicechannel.cpp2
-rw-r--r--indra/newview/llvoiceclient.cpp4
-rw-r--r--indra/newview/llvoicewebrtc.cpp12
3 files changed, 10 insertions, 8 deletions
diff --git a/indra/newview/llvoicechannel.cpp b/indra/newview/llvoicechannel.cpp
index 5802cd0f1e..f6658bbaab 100644
--- a/indra/newview/llvoicechannel.cpp
+++ b/indra/newview/llvoicechannel.cpp
@@ -418,7 +418,7 @@ void LLVoiceChannelGroup::activate()
{
// we have the channel info, just need to use it now
LLVoiceClient::getInstance()->setNonSpatialChannel(mChannelInfo,
- mCallDirection == OUTGOING_CALL,
+ mIsP2P && (mCallDirection == OUTGOING_CALL),
mIsP2P);
if (mIsP2P)
diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp
index b9b8742c41..9dbf469ca8 100644
--- a/indra/newview/llvoiceclient.cpp
+++ b/indra/newview/llvoiceclient.cpp
@@ -382,14 +382,14 @@ void LLVoiceClient::refreshDeviceLists(bool clearCurrentList)
void LLVoiceClient::setCaptureDevice(const std::string& name)
{
+ LLVivoxVoiceClient::getInstance()->setCaptureDevice(name);
LLWebRTCVoiceClient::getInstance()->setCaptureDevice(name);
- LLVivoxVoiceClient::getInstance()->setCaptureDevice(name);
}
void LLVoiceClient::setRenderDevice(const std::string& name)
{
+ LLVivoxVoiceClient::getInstance()->setRenderDevice(name);
LLWebRTCVoiceClient::getInstance()->setRenderDevice(name);
- LLVivoxVoiceClient::getInstance()->setRenderDevice(name);
}
const LLVoiceDeviceList& LLVoiceClient::getCaptureDevices()
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(