diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 476d752ea..dfc036096 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -16916,6 +16916,28 @@ This should be as low as possible, but too low may break functionality Value 0 + VivoxShutdownTimeout + + Comment + shutdown timeout in miliseconds. The amount of time to wait for the service to shutdown gracefully after the last disconnect + Persist + 1 + Type + String + Value + 5 + + VivoxLogDirectory + + Comment + Default log path is Application Support/SecondLife/logs specify alternate absolute path here. + Persist + 1 + Type + String + Value + + VivoxDebugSIPURIHostName Comment diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index dc7ffb2a0..7bb5ce058 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -3918,6 +3918,9 @@ void LLAppViewer::idle() // hover callbacks // +#ifdef LL_DARWIN + if (mQuitRequested) //MAINT-4243 +#endif { LLFastTimer t(FTM_IDLE_CB); diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index 24be99f42..c87a3b61d 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -349,6 +349,7 @@ LLVivoxVoiceClient::LLVivoxVoiceClient() : mCaptureBufferRecording(false), mCaptureBufferRecorded(false), mCaptureBufferPlaying(false), + mShutdownComplete(true), mPlayRequestCount(0), mAvatarNameCacheConnection() @@ -404,6 +405,14 @@ void LLVivoxVoiceClient::terminate() { logout(); connectorShutdown(); +#ifdef LL_WINDOWS + S32 count = 0; + while (!mShutdownComplete && 10 > ++count) + { + stateMachine(); + _sleep(1000); + } +#endif // LL_WINDOW closeSocket(); // Need to do this now -- bad things happen if the destructor does it later. cleanUp(); } @@ -503,10 +512,9 @@ void LLVivoxVoiceClient::connectorCreate() std::string savedLogLevel = gSavedSettings.getString("VivoxDebugLevel"); - if(savedLogLevel != "-0") + if(savedLogLevel != "0") { LL_DEBUGS("Voice") << "creating connector with logging enabled" << LL_ENDL; - loglevel = "0"; } stream @@ -524,13 +532,14 @@ void LLVivoxVoiceClient::connectorCreate() stream << "" - << "" << logpath << "" - << "Connector" - << ".log" - << "" << loglevel << "" + << "" << logpath << "" + << "Connector" + << ".log" + << "" << loglevel << "" << "" - << "SecondLifeViewer.1" - << "\n\n\n"; + << "" //Name can cause problems per vivox. + << "12" + << "\n\n\n"; writeString(stream.str()); } @@ -548,6 +557,7 @@ void LLVivoxVoiceClient::connectorShutdown() << "" << "\n\n\n"; + mShutdownComplete = false; mConnectorHandle.clear(); writeString(stream.str()); @@ -838,6 +848,7 @@ void LLVivoxVoiceClient::stateMachine() std::string args, cmd; std::string loglevel = gSavedSettings.getString("VivoxDebugLevel"); + std::string shutdown_timeout = gSavedSettings.getString("VivoxShutdownTimeout"); if(loglevel.empty()) { loglevel = "0"; // turn logging off completely @@ -851,6 +862,19 @@ void LLVivoxVoiceClient::stateMachine() #else args += loglevel; #endif + args += " -lf "; + std::string log_folder = gSavedSettings.getString("VivoxLogDirectory"); + if (log_folder.empty()) + { + log_folder = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, ""); + } + args += "logfolder"; + + if(!shutdown_timeout.empty()) + { + args += " -st "; + args += shutdown_timeout; + } // If we allow multiple instances of the viewer to start the voicedaemon if (gSavedSettings.getBOOL("VoiceMultiInstance")) @@ -1640,7 +1664,7 @@ void LLVivoxVoiceClient::stateMachine() // Always reset the terminate request flag when we get here. mSessionTerminateRequested = false; - if((mVoiceEnabled || !mIsInitialized) && !mRelogRequested) + if((mVoiceEnabled || !mIsInitialized) && !mRelogRequested && !LLApp::isExiting()) { // Just leaving a channel, go back to stateNoChannel (the "logged in but have no channel" state). setState(stateNoChannel); @@ -1683,6 +1707,7 @@ void LLVivoxVoiceClient::stateMachine() //MARK: stateConnectorStopping case stateConnectorStopping: // waiting for connector stop // The handler for the Connector.InitiateShutdown response will transition from here to stateConnectorStopped. + mShutdownComplete = true; break; //MARK: stateConnectorStopped diff --git a/indra/newview/llvoicevivox.h b/indra/newview/llvoicevivox.h index 3843bbd7e..05e841863 100644 --- a/indra/newview/llvoicevivox.h +++ b/indra/newview/llvoicevivox.h @@ -876,6 +876,7 @@ private: bool mCaptureBufferRecording; // A voice sample is being captured. bool mCaptureBufferRecorded; // A voice sample is captured in the buffer ready to play. bool mCaptureBufferPlaying; // A voice sample is being played. + bool mShutdownComplete; LLTimer mCaptureTimer; LLUUID mPreviewVoiceFont;