diff options
Diffstat (limited to 'indra/newview/llvoicevivox.cpp')
-rw-r--r-- | indra/newview/llvoicevivox.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index fe497ee3be..285ce298b0 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -248,6 +248,7 @@ static bool sMuteListListener_listening = false; /////////////////////////////////////////////////////////////////////////////////////////////// static LLProcessPtr sGatewayPtr; +static LLEventStream sGatewayPump("VivoxDaemonPump", true); static bool isGatewayRunning() { @@ -258,6 +259,7 @@ static void killGateway() { if (sGatewayPtr) { + sGatewayPump.stopListening("VivoxDaemonPump"); sGatewayPtr->kill(); } } @@ -709,6 +711,19 @@ bool LLVivoxVoiceClient::endAndDisconnectSession() return true; } +bool LLVivoxVoiceClient::callbackEndDaemon(const LLSD& data) +{ + if (!LLAppViewer::isExiting()) + { + terminateAudioSession(false); + closeSocket(); + cleanUp(); + LLVoiceClient::getInstance()->setUserPTTState(false); + gAgent.setVoiceConnected(false); + } + sGatewayPump.stopListening("VivoxDaemonPump"); + return false; +} bool LLVivoxVoiceClient::startAndLaunchDaemon() { @@ -779,6 +794,9 @@ bool LLVivoxVoiceClient::startAndLaunchDaemon() params.args.add(LLVivoxSecurity::getInstance()->connectorHandle()); # endif // VIVOX_HANDLE_ARGS + params.postend = sGatewayPump.getName(); + sGatewayPump.listen("VivoxDaemonPump", boost::bind(&LLVivoxVoiceClient::callbackEndDaemon, this, _1)); + sGatewayPtr = LLProcess::create(params); mDaemonHost = LLHost(gSavedSettings.getString("VivoxVoiceHost").c_str(), gSavedSettings.getU32("VivoxVoicePort")); |