MAINT-8362 Don't reconnect voice while in teleport

Fri, 09 Mar 2018 16:57:47 +0200

author
andreykproductengine <andreykproductengine@lindenlab.com>
date
Fri, 09 Mar 2018 16:57:47 +0200
changeset 55332
eb12b1bdf847
parent 55331
be6bd8f683ff
child 55333
8f47409b63be
child 55336
5c65f763f4e4
child 55341
2c3f25a6b5b9

MAINT-8362 Don't reconnect voice while in teleport

indra/newview/llvoicevivox.cpp file | annotate | diff | revisions
     1.1 --- a/indra/newview/llvoicevivox.cpp	Fri Mar 09 17:26:41 2018 +0200
     1.2 +++ b/indra/newview/llvoicevivox.cpp	Fri Mar 09 16:57:47 2018 +0200
     1.3 @@ -643,7 +643,13 @@
     1.4  {
     1.5      mIsCoroutineActive = true;
     1.6      LLCoros::set_consuming(true);
     1.7 -    
     1.8 +
     1.9 +    while (gAgent.getTeleportState() != LLAgent::TELEPORT_NONE)
    1.10 +    {
    1.11 +        LL_INFOS("Voice") << "Suspending voiceControlCoro() due to teleport. Tuning: " << mTuningMode << ". Relog: " << mRelogRequested << LL_ENDL;
    1.12 +        llcoro::suspendUntilTimeout(1.0);
    1.13 +    }
    1.14 +
    1.15      do
    1.16      {
    1.17          
    1.18 @@ -665,7 +671,7 @@
    1.19          // and then reconstruct the voice connecion from scratch.
    1.20          if (mRelogRequested)
    1.21          {
    1.22 -            while (isGatewayRunning())
    1.23 +            while (isGatewayRunning() || gAgent.getTeleportState() != LLAgent::TELEPORT_NONE)
    1.24              {
    1.25                  llcoro::suspendUntilTimeout(1.0);
    1.26              }
    1.27 @@ -1302,7 +1308,7 @@
    1.28  
    1.29      mAudioSession = nextSession;
    1.30      mAudioSessionChanged = true;
    1.31 -    if (!mAudioSession->mReconnect)
    1.32 +    if (!mAudioSession || !mAudioSession->mReconnect)
    1.33      {
    1.34          mNextAudioSession.reset();
    1.35      }
    1.36 @@ -1310,16 +1316,19 @@
    1.37      // The old session may now need to be deleted.
    1.38      reapSession(oldSession);
    1.39  
    1.40 -    if (!mAudioSession->mHandle.empty())
    1.41 +    if (mAudioSession)
    1.42      {
    1.43 -        // Connect to a session by session handle
    1.44 -
    1.45 -        sessionMediaConnectSendMessage(mAudioSession);
    1.46 -    }
    1.47 -    else
    1.48 -    {
    1.49 -        // Connect to a session by URI
    1.50 -        sessionCreateSendMessage(mAudioSession, true, false);
    1.51 +        if (!mAudioSession->mHandle.empty())
    1.52 +        {
    1.53 +            // Connect to a session by session handle
    1.54 +
    1.55 +            sessionMediaConnectSendMessage(mAudioSession);
    1.56 +        }
    1.57 +        else
    1.58 +        {
    1.59 +            // Connect to a session by URI
    1.60 +            sessionCreateSendMessage(mAudioSession, true, false);
    1.61 +        }
    1.62      }
    1.63  
    1.64      notifyStatusObservers(LLVoiceClientStatusObserver::STATUS_JOINING);
    1.65 @@ -1384,6 +1393,11 @@
    1.66          LL_INFOS("Voice") << "event=" << ll_stream_notation_sd(result) << LL_ENDL;
    1.67          if (result.has("session"))
    1.68          {
    1.69 +            if (!mAudioSession)
    1.70 +            {
    1.71 +                LL_WARNS("Voice") << "Message for session handle \"" << result["handle"] << "\" while session is not initialized." << LL_ENDL;
    1.72 +                continue;
    1.73 +            }
    1.74              if (result.has("handle") && result["handle"] != mAudioSession->mHandle)
    1.75              {
    1.76                  LL_WARNS("Voice") << "Message for session handle \"" << result["handle"] << "\" while waiting for \"" << mAudioSession->mHandle << "\"." << LL_ENDL;
    1.77 @@ -1722,6 +1736,11 @@
    1.78          {   
    1.79              if (result.has("handle"))
    1.80              {
    1.81 +                if (!mAudioSession)
    1.82 +                {
    1.83 +                    LL_WARNS("Voice") << "Message for session handle \"" << result["handle"] << "\" while session is not initiated." << LL_ENDL;
    1.84 +                    continue;
    1.85 +                }
    1.86                  if (result["handle"] != mAudioSession->mHandle)
    1.87                  {
    1.88                      LL_WARNS("Voice") << "Message for session handle \"" << result["handle"] << "\" while waiting for \"" << mAudioSession->mHandle << "\"." << LL_ENDL;

mercurial