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.cpp41
1 files changed, 30 insertions, 11 deletions
diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp
index 6e5a5e3084..838de48308 100644
--- a/indra/newview/llvoicevivox.cpp
+++ b/indra/newview/llvoicevivox.cpp
@@ -643,7 +643,13 @@ void LLVivoxVoiceClient::voiceControlCoro()
{
mIsCoroutineActive = true;
LLCoros::set_consuming(true);
-
+
+ while (gAgent.getTeleportState() != LLAgent::TELEPORT_NONE)
+ {
+ LL_INFOS("Voice") << "Suspending voiceControlCoro() due to teleport. Tuning: " << mTuningMode << ". Relog: " << mRelogRequested << LL_ENDL;
+ llcoro::suspendUntilTimeout(1.0);
+ }
+
do
{
@@ -665,7 +671,7 @@ void LLVivoxVoiceClient::voiceControlCoro()
// and then reconstruct the voice connecion from scratch.
if (mRelogRequested)
{
- while (isGatewayRunning())
+ while (isGatewayRunning() || gAgent.getTeleportState() != LLAgent::TELEPORT_NONE)
{
llcoro::suspendUntilTimeout(1.0);
}
@@ -1302,7 +1308,7 @@ bool LLVivoxVoiceClient::addAndJoinSession(const sessionStatePtr_t &nextSession)
mAudioSession = nextSession;
mAudioSessionChanged = true;
- if (!mAudioSession->mReconnect)
+ if (!mAudioSession || !mAudioSession->mReconnect)
{
mNextAudioSession.reset();
}
@@ -1310,16 +1316,19 @@ bool LLVivoxVoiceClient::addAndJoinSession(const sessionStatePtr_t &nextSession)
// The old session may now need to be deleted.
reapSession(oldSession);
- if (!mAudioSession->mHandle.empty())
+ if (mAudioSession)
{
- // Connect to a session by session handle
+ if (!mAudioSession->mHandle.empty())
+ {
+ // Connect to a session by session handle
- sessionMediaConnectSendMessage(mAudioSession);
- }
- else
- {
- // Connect to a session by URI
- sessionCreateSendMessage(mAudioSession, true, false);
+ sessionMediaConnectSendMessage(mAudioSession);
+ }
+ else
+ {
+ // Connect to a session by URI
+ sessionCreateSendMessage(mAudioSession, true, false);
+ }
}
notifyStatusObservers(LLVoiceClientStatusObserver::STATUS_JOINING);
@@ -1384,6 +1393,11 @@ bool LLVivoxVoiceClient::addAndJoinSession(const sessionStatePtr_t &nextSession)
LL_INFOS("Voice") << "event=" << ll_stream_notation_sd(result) << LL_ENDL;
if (result.has("session"))
{
+ if (!mAudioSession)
+ {
+ LL_WARNS("Voice") << "Message for session handle \"" << result["handle"] << "\" while session is not initialized." << LL_ENDL;
+ continue;
+ }
if (result.has("handle") && result["handle"] != mAudioSession->mHandle)
{
LL_WARNS("Voice") << "Message for session handle \"" << result["handle"] << "\" while waiting for \"" << mAudioSession->mHandle << "\"." << LL_ENDL;
@@ -1722,6 +1736,11 @@ bool LLVivoxVoiceClient::runSession(const sessionStatePtr_t &session)
{
if (result.has("handle"))
{
+ if (!mAudioSession)
+ {
+ LL_WARNS("Voice") << "Message for session handle \"" << result["handle"] << "\" while session is not initiated." << LL_ENDL;
+ continue;
+ }
if (result["handle"] != mAudioSession->mHandle)
{
LL_WARNS("Voice") << "Message for session handle \"" << result["handle"] << "\" while waiting for \"" << mAudioSession->mHandle << "\"." << LL_ENDL;