summaryrefslogtreecommitdiff
path: root/indra/newview/llvoicevivox.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llvoicevivox.cpp')
-rwxr-xr-xindra/newview/llvoicevivox.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp
index c0168d38ba..9d1c84875e 100755
--- a/indra/newview/llvoicevivox.cpp
+++ b/indra/newview/llvoicevivox.cpp
@@ -268,6 +268,7 @@ LLVivoxVoiceClient::LLVivoxVoiceClient() :
mSessionTerminateRequested(false),
mRelogRequested(false),
mConnected(false),
+ mTerminateDaemon(false),
mPump(NULL),
mSpatialJoiningNum(0),
@@ -702,7 +703,7 @@ void LLVivoxVoiceClient::stateMachine()
setVoiceEnabled(false);
}
- if(mVoiceEnabled || !mIsInitialized)
+ if(mVoiceEnabled || (!mIsInitialized &&!mTerminateDaemon) )
{
updatePosition();
}
@@ -715,11 +716,12 @@ void LLVivoxVoiceClient::stateMachine()
if((getState() != stateDisabled) && (getState() != stateDisableCleanup))
{
// User turned off voice support. Send the cleanup messages, close the socket, and reset.
- if(!mConnected)
+ if(!mConnected || mTerminateDaemon)
{
// if voice was turned off after the daemon was launched but before we could connect to it, we may need to issue a kill.
LL_INFOS("Voice") << "Disabling voice before connection to daemon, terminating." << LL_ENDL;
killGateway();
+ mTerminateDaemon = false;
}
logout();
@@ -760,7 +762,7 @@ void LLVivoxVoiceClient::stateMachine()
// Voice is locked out, we must not launch the vivox daemon.
setState(stateJail);
}
- else if(!isGatewayRunning())
+ else if(!isGatewayRunning() && gSavedSettings.getBOOL("EnableVoiceChat"))
{
if (true) // production build, not test
{
@@ -1143,6 +1145,7 @@ void LLVivoxVoiceClient::stateMachine()
std::stringstream errs;
errs << mVoiceAccountServerURI << "\n:UDP: 3478, 3479, 5060, 5062, 12000-17000";
args["HOSTID"] = errs.str();
+ mTerminateDaemon = true;
if (LLGridManager::getInstance()->isSystemGrid())
{
LLNotificationsUtil::add("NoVoiceConnect", args);
@@ -2625,6 +2628,7 @@ void LLVivoxVoiceClient::connectorCreateResponse(int statusCode, std::string &st
std::stringstream errs;
errs << mVoiceAccountServerURI << "\n:UDP: 3478, 3479, 5060, 5062, 12000-17000";
args["HOSTID"] = errs.str();
+ mTerminateDaemon = true;
if (LLGridManager::getInstance()->isSystemGrid())
{
LLNotificationsUtil::add("NoVoiceConnect", args);
@@ -2640,6 +2644,7 @@ void LLVivoxVoiceClient::connectorCreateResponse(int statusCode, std::string &st
LL_INFOS("Voice") << "Connector.Create succeeded, Vivox SDK version is " << versionID << LL_ENDL;
mVoiceVersion.serverVersion = versionID;
mConnectorHandle = connectorHandle;
+ mTerminateDaemon = false;
if(getState() == stateConnectorStarting)
{
setState(stateConnectorStarted);