summaryrefslogtreecommitdiff
path: root/indra/newview/llvoicewebrtc.cpp
diff options
context:
space:
mode:
authorRoxie Linden <roxie@lindenlab.com>2024-02-22 14:34:03 -0800
committerRoxie Linden <roxie@lindenlab.com>2024-02-22 14:34:03 -0800
commit7287cfbd7ad8f61114d0176c6fc7c3218c758900 (patch)
tree4204306e6a4dad95f6e524a3c881429e0b7e0311 /indra/newview/llvoicewebrtc.cpp
parent70068a244b55c00a51cc48f09634a2fe4cedd54b (diff)
For spatial voice, determine voice provider based on server setting.
Diffstat (limited to 'indra/newview/llvoicewebrtc.cpp')
-rw-r--r--indra/newview/llvoicewebrtc.cpp22
1 files changed, 19 insertions, 3 deletions
diff --git a/indra/newview/llvoicewebrtc.cpp b/indra/newview/llvoicewebrtc.cpp
index d3b9f8ba2c..0332557229 100644
--- a/indra/newview/llvoicewebrtc.cpp
+++ b/indra/newview/llvoicewebrtc.cpp
@@ -93,7 +93,8 @@ namespace {
const F32 SPEAKING_TIMEOUT = 1.f;
const F32 SPEAKING_AUDIO_LEVEL = 0.40;
- static const std::string VOICE_SERVER_TYPE = "WebRTC";
+ static const std::string VISIBLE_VOICE_SERVER_TYPE = "WebRTC";
+ static const std::string WEBRTC_VOICE_SERVER_TYPE = "webrtc";
// Don't send positional updates more frequently than this:
const F32 UPDATE_THROTTLE_SECONDS = 0.1f;
@@ -289,7 +290,7 @@ LLWebRTCVoiceClient::LLWebRTCVoiceClient() :
mSpeakerVolume = 0.0;
mVoiceVersion.serverVersion = "";
- mVoiceVersion.serverType = VOICE_SERVER_TYPE;
+ mVoiceVersion.voiceServerType = VISIBLE_VOICE_SERVER_TYPE;
#if LL_DARWIN || LL_LINUX
// HACK: THIS DOES NOT BELONG HERE
@@ -559,10 +560,24 @@ void LLWebRTCVoiceClient::voiceConnectionCoro()
continue;
}
+ LLViewerRegion *regionp = gAgent.getRegion();
+ if (!regionp)
+ {
+ continue;
+ }
+ LLVoiceVersionInfo version = LLVoiceClient::getInstance()->getVersion();
+ if (version.voiceServerType != VISIBLE_VOICE_SERVER_TYPE)
+ {
+ // we've switched away from webrtc voice, so shut all channels down.
+ // leave channel can be called again and again without adverse effects.
+ // it merely tells channels to shut down if they're not already doing so.
+ leaveChannel(false);
+ continue;
+ }
+
if (inSpatialChannel())
{
// add session for region or parcel voice.
- LLViewerRegion *regionp = gAgent.getRegion();
if (!regionp || regionp->getRegionID().isNull())
{
continue;
@@ -2752,6 +2767,7 @@ void LLVoiceWebRTCConnection::OnVoiceConnectionRequestSuccess(const LLSD &result
}
else
{
+ LL_WARNS("Voice") << "Invalid voice provision request result:" << result << LL_ENDL;
setVoiceConnectionState(VOICE_STATE_SESSION_RETRY);
mOutstandingRequests--;
return;