diff options
author | Oz Linden <oz@lindenlab.com> | 2017-03-14 09:07:35 -0400 |
---|---|---|
committer | Oz Linden <oz@lindenlab.com> | 2017-03-14 09:07:35 -0400 |
commit | 4e537be8abb141e0a29679e15434bbcef7662dfa (patch) | |
tree | 9b12d393a7eea9ee0d4d5e3629502d61ec443430 | |
parent | ddc2848428022ea63c87fe836f340319da984462 (diff) |
fix shadowed variable, disable daemon launch of voice disabled
-rw-r--r-- | indra/newview/llvoicevivox.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index 8e5ae57842..6062eea68d 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -713,13 +713,13 @@ bool LLVivoxVoiceClient::endAndDisconnectSession() bool LLVivoxVoiceClient::startAndLaunchDaemon() { //--------------------------------------------------------------------- - if (gSavedSettings.getBOOL("CmdLineDisableVoice")) + if (!voiceEnabled()) { // Voice is locked out, we must not launch the vivox daemon. return false; } - if (!isGatewayRunning() && gSavedSettings.getBOOL("EnableVoiceChat")) + if (!isGatewayRunning()) { #ifndef VIVOXDAEMON_REMOTEHOST // Launch the voice daemon @@ -969,7 +969,7 @@ bool LLVivoxVoiceClient::establishVoiceConnection() if (result.has("connector")) { LLVoiceVivoxStats::getInstance()->establishAttemptEnd(connected); - bool connected = LLSD::Boolean(result["connector"]); + connected = LLSD::Boolean(result["connector"]); if (!connected) { if (result.has("retry") && ++retries <= CONNECT_RETRY_MAX) @@ -4965,10 +4965,9 @@ void LLVivoxVoiceClient::setVoiceEnabled(bool enabled) bool LLVivoxVoiceClient::voiceEnabled() { - LL_DEBUGS("Voice") << "EnableVoiceChat" << (gSavedSettings.getBOOL("EnableVoiceChat") ? "on" : "off") << " ," - << "CmdLineDisableVoice" << (gSavedSettings.getBOOL("CmdLineDisableVoice") ? "on" : "off") - << LL_ENDL; - return gSavedSettings.getBOOL("EnableVoiceChat") && !gSavedSettings.getBOOL("CmdLineDisableVoice"); + static LLUICachedControl<bool> enable_voice("EnableVoiceChat"); + static LLUICachedControl<bool> override_disable_voice("CmdLineDisableVoice"); + return enable_voice && ! override_disable_voice; } void LLVivoxVoiceClient::setLipSyncEnabled(BOOL enabled) |