summaryrefslogtreecommitdiff
path: root/indra/newview/llvoicevivox.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llvoicevivox.cpp')
-rw-r--r--indra/newview/llvoicevivox.cpp20
1 files changed, 13 insertions, 7 deletions
diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp
index 17fd85f280..fcb8a0a4f2 100644
--- a/indra/newview/llvoicevivox.cpp
+++ b/indra/newview/llvoicevivox.cpp
@@ -1284,7 +1284,7 @@ bool LLVivoxVoiceClient::establishVoiceConnection()
{
if (result.has("retry") && ++retries <= CONNECT_RETRY_MAX && !sShuttingDown)
{
- F32 timeout = LLSD::Real(result["retry"]);
+ F32 timeout = (F32)LLSD::Real(result["retry"]);
timeout *= retries;
LL_INFOS("Voice") << "Retry connection to voice service in " << timeout << " seconds" << LL_ENDL;
llcoro::suspendUntilTimeout(timeout);
@@ -5107,25 +5107,31 @@ void LLVivoxVoiceClient::processChannels(bool process)
bool LLVivoxVoiceClient::isCurrentChannel(const LLSD &channelInfo)
{
- if (!mProcessChannels || (channelInfo["voice_server_type"].asString() != VIVOX_VOICE_SERVER_TYPE))
+ if (!mProcessChannels || (channelInfo.has("voice_server_type") && channelInfo["voice_server_type"].asString() != VIVOX_VOICE_SERVER_TYPE))
{
return false;
}
- if (mAudioSession)
+ // favor the next audio session, as that's the one we're bringing up.
+ sessionStatePtr_t session = mNextAudioSession;
+ if (!session)
+ {
+ session = mAudioSession;
+ }
+ if (session)
{
if (!channelInfo["session_handle"].asString().empty())
{
- return mAudioSession->mHandle == channelInfo["session_handle"].asString();
+ return session->mHandle == channelInfo["session_handle"].asString();
}
- return channelInfo["channel_uri"].asString() == mAudioSession->mSIPURI;
+ return channelInfo["channel_uri"].asString() == session->mSIPURI;
}
return false;
}
bool LLVivoxVoiceClient::compareChannels(const LLSD& channelInfo1, const LLSD& channelInfo2)
{
- return (channelInfo1["voice_server_type"] == VIVOX_VOICE_SERVER_TYPE) &&
- (channelInfo1["voice_server_type"] == channelInfo2["voice_server_type"]) &&
+ return (!channelInfo1.has("voice_server_type") || (channelInfo1["voice_server_type"] == VIVOX_VOICE_SERVER_TYPE)) &&
+ (!channelInfo2.has("voice_server_type") || (channelInfo2["voice_server_type"] == VIVOX_VOICE_SERVER_TYPE)) &&
(channelInfo1["channel_uri"] == channelInfo2["channel_uri"]);
}