From 4683fb49075949485d6f2252295046b0fc0fcc01 Mon Sep 17 00:00:00 2001 From: Player Dagostino Date: Thu, 11 Aug 2011 06:19:59 +0200 Subject: [PATCH] On Linux and in standalone mode, first look for SLVoice in the executable path list. If none is found then try to use the one installed with Singularity, if any. Useful for packagers who want to make many sl clients share the same voice program. --- indra/newview/llvoiceclient.cpp | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp index 79e8fc535..3eba0c924 100644 --- a/indra/newview/llvoiceclient.cpp +++ b/indra/newview/llvoiceclient.cpp @@ -29,6 +29,9 @@ * COMPLETENESS OR PERFORMANCE. * $/LicenseInfo$ */ +#if LL_LINUX && defined(LL_STANDALONE) +#include +#endif #include "llviewerprecompiledheaders.h" #include "llvoiceclient.h" @@ -1635,9 +1638,22 @@ void LLVoiceClient::stateMachine() { // Launch the voice daemon - // *FIX:Mani - Using the executable dir instead - // of mAppRODataDir, the working directory from which the app - // is launched. +#if LL_LINUX && defined(LL_STANDALONE) + // Look for the vivox daemon in the executable path list + // using glib first. + char *voice_path = g_find_program_in_path ("SLVoice"); + std::string exe_path; + if (voice_path) { + exe_path = llformat("%s", voice_path); + free(voice_path); + } else { + exe_path = gDirUtilp->getExecutableDir() + + gDirUtilp->getDirDelimiter() + "SLVoice"; + } +#else + // *FIX:Mani - Using the executable dir instead + // of mAppRODataDir, the working directory from which the + // app is launched. //std::string exe_path = gDirUtilp->getAppRODataDir(); std::string exe_path = gDirUtilp->getExecutableDir(); exe_path += gDirUtilp->getDirDelimiter(); @@ -1647,6 +1663,7 @@ void LLVoiceClient::stateMachine() exe_path += "../Resources/SLVoice"; #else exe_path += "SLVoice"; +#endif #endif // See if the vivox executable exists llstat s;