summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorBjoseph Wombat <bjoseph@vivox.com>2015-03-03 18:04:05 +0000
committerBjoseph Wombat <bjoseph@vivox.com>2015-03-03 18:04:05 +0000
commit89690140c79dcbd8466ebd1c637f474670e3a7ce (patch)
treea954e4a5f3cd1b8253a99a164001f0ab7ea95a76 /indra/newview
parentd4a2e9fd9a0e7001a6c824ddd6cf37039a632b9d (diff)
Better MediaConnect handling of 1026 return status, media already connected.
Diffstat (limited to 'indra/newview')
-rwxr-xr-xindra/newview/llvoicevivox.cpp28
1 files changed, 22 insertions, 6 deletions
diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp
index a6a7a35b03..ac264d395f 100755
--- a/indra/newview/llvoicevivox.cpp
+++ b/indra/newview/llvoicevivox.cpp
@@ -95,7 +95,7 @@ const int MAX_LOGIN_RETRIES = 12;
// to voice server (EXT-4313). When voice works correctly, there is from 1 to 15 times. 50 was chosen
// to make sure we don't make mistake when slight connection problems happen- situation when connection to server is
// blocked is VERY rare and it's better to sacrifice response time in this situation for the sake of stability.
-const int MAX_NORMAL_JOINING_SPATIAL_NUM = 50;
+const int MAX_NORMAL_JOINING_SPATIAL_NUM = 150;
// How often to check for expired voice fonts in seconds
const F32 VOICE_FONT_EXPIRY_INTERVAL = 10.f;
@@ -1512,7 +1512,7 @@ void LLVivoxVoiceClient::stateMachine()
//MARK: stateLeavingSession
case stateLeavingSession: // waiting for terminate session response
// The handler for the Session.Terminate response will transition from here to stateSessionTerminated.
- break;
+ //break; // brett, should fall through and clean up session before getting terminated event.
//MARK: stateSessionTerminated
case stateSessionTerminated:
@@ -1522,6 +1522,7 @@ void LLVivoxVoiceClient::stateMachine()
if(mAudioSession)
{
+ leaveAudioSession();
sessionState *oldSession = mAudioSession;
mAudioSession = NULL;
@@ -1881,6 +1882,7 @@ void LLVivoxVoiceClient::leaveAudioSession()
case stateJoiningSession:
case stateSessionJoined:
case stateRunning:
+ case stateSessionTerminated:
if(!mAudioSession->mHandle.empty())
{
@@ -2813,15 +2815,24 @@ void LLVivoxVoiceClient::sessionGroupAddSessionResponse(std::string &requestId,
void LLVivoxVoiceClient::sessionConnectResponse(std::string &requestId, int statusCode, std::string &statusString)
{
sessionState *session = findSession(requestId);
- if(statusCode != 0)
+ // 1026 is session already has media, somehow mediaconnect was called twice on the same session.
+ // set the session info to reflect that the user is already connected.
+ if (statusCode == 1026){
+ session->mVoiceEnabled = true;
+ session->mMediaConnectInProgress = false;
+ session->mMediaStreamState = streamStateConnected;
+ session->mTextStreamState = streamStateConnected;
+ session->mErrorStatusCode = 0;
+ }
+ else if (statusCode != 0)
{
LL_WARNS("Voice") << "Session.Connect response failure (" << statusCode << "): " << statusString << LL_ENDL;
- if(session)
+ if (session)
{
session->mMediaConnectInProgress = false;
- session->mErrorStatusCode = statusCode;
+ session->mErrorStatusCode = statusCode;
session->mErrorStatusString = statusString;
- if(session == mAudioSession)
+ if (session == mAudioSession)
setState(stateJoinSessionFailed);
}
}
@@ -4611,6 +4622,11 @@ void LLVivoxVoiceClient::enforceTether(void)
void LLVivoxVoiceClient::updatePosition(void)
{
+ // Throttle the position updates to one every 1/10 of a second if we are in an audio session at all
+ if (mAudioSession == NULL) {
+ return;
+ }
+
LLViewerRegion *region = gAgent.getRegion();
if(region && isAgentAvatarValid())
{