Merge branch 'master' of https://Shyotl@bitbucket.org/LightDrake/singularityviewer-internal.git into FMODStudio
Conflicts: indra/llcommon/llsingleton.h
This commit is contained in:
@@ -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
|
||||
<< "<Logging>"
|
||||
<< "<Folder>" << logpath << "</Folder>"
|
||||
<< "<FileNamePrefix>Connector</FileNamePrefix>"
|
||||
<< "<FileNameSuffix>.log</FileNameSuffix>"
|
||||
<< "<LogLevel>" << loglevel << "</LogLevel>"
|
||||
<< "<Folder>" << logpath << "</Folder>"
|
||||
<< "<FileNamePrefix>Connector</FileNamePrefix>"
|
||||
<< "<FileNameSuffix>.log</FileNameSuffix>"
|
||||
<< "<LogLevel>" << loglevel << "</LogLevel>"
|
||||
<< "</Logging>"
|
||||
<< "<Application>SecondLifeViewer.1</Application>"
|
||||
<< "</Request>\n\n\n";
|
||||
<< "<Application></Application>" //Name can cause problems per vivox.
|
||||
<< "<MaxCalls>12</MaxCalls>"
|
||||
<< "</Request>\n\n\n";
|
||||
|
||||
writeString(stream.str());
|
||||
}
|
||||
@@ -548,6 +557,7 @@ void LLVivoxVoiceClient::connectorShutdown()
|
||||
<< "</Request>"
|
||||
<< "\n\n\n";
|
||||
|
||||
mShutdownComplete = false;
|
||||
mConnectorHandle.clear();
|
||||
|
||||
writeString(stream.str());
|
||||
@@ -836,9 +846,13 @@ void LLVivoxVoiceClient::stateMachine()
|
||||
{
|
||||
// vivox executable exists. Build the command line and launch the daemon.
|
||||
std::string args, cmd;
|
||||
// SLIM SDK: these arguments are no longer necessary.
|
||||
// std::string args = " -p tcp -h -c";
|
||||
|
||||
std::string loglevel = gSavedSettings.getString("VivoxDebugLevel");
|
||||
// Singu Note: omit shutdown timeout for Linux, as we are using 2.x version of the SDK there
|
||||
// Singu TODO: Remove this when the Vivox SDK 4.x is working on Linux
|
||||
#ifndef LL_LINUX
|
||||
std::string shutdown_timeout = gSavedSettings.getString("VivoxShutdownTimeout");
|
||||
#endif
|
||||
if(loglevel.empty())
|
||||
{
|
||||
loglevel = "0"; // turn logging off completely
|
||||
@@ -852,6 +866,23 @@ 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";
|
||||
|
||||
// Singu Note: omit shutdown timeout for Linux, as we are using 2.x version of the SDK there
|
||||
// Singu TODO: Remove this when the Vivox SDK 4.x is working on Linux
|
||||
#ifndef LL_LINUX
|
||||
if(!shutdown_timeout.empty())
|
||||
{
|
||||
args += " -st ";
|
||||
args += shutdown_timeout;
|
||||
}
|
||||
#endif
|
||||
|
||||
// If we allow multiple instances of the viewer to start the voicedaemon
|
||||
if (gSavedSettings.getBOOL("VoiceMultiInstance"))
|
||||
@@ -1641,7 +1672,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);
|
||||
@@ -1684,6 +1715,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
|
||||
|
||||
Reference in New Issue
Block a user