Browse Source

Cleanup some jack-plugin code

tags/1.9.8
falkTX 7 years ago
parent
commit
1afdb860c1
2 changed files with 17 additions and 16 deletions
  1. +9
    -16
      source/backend/plugin/CarlaPluginJack.cpp
  2. +8
    -0
      source/interposer/libjack.cpp

+ 9
- 16
source/backend/plugin/CarlaPluginJack.cpp View File

@@ -28,6 +28,7 @@
#include "CarlaBridgeUtils.hpp"
#include "CarlaEngineUtils.hpp"
#include "CarlaMathUtils.hpp"
#include "CarlaPipeUtils.hpp"
#include "CarlaShmUtils.hpp"
#include "CarlaThread.hpp"

@@ -106,32 +107,24 @@ protected:
bool started;

{
const EngineOptions& options(kEngine->getOptions());

char strBuf[STR_MAX+1];
std::snprintf(strBuf, STR_MAX, P_UINTPTR, options.frontendWinId);
strBuf[STR_MAX] = '\0';

const EngineOptions& options(kEngine->getOptions());
CarlaString libjackdir(options.binaryDir);
libjackdir += "/jack";

const ScopedEngineEnvironmentLocker _seel(kEngine);

#ifdef CARLA_OS_LINUX
const char* const oldPreload(std::getenv("LD_PRELOAD"));
const ScopedEnvVar sev1("LD_PRELOAD", nullptr);
const ScopedEnvVar sev2("LD_LIBRARY_PATH", libjackdir.buffer());

if (oldPreload != nullptr)
::unsetenv("LD_PRELOAD");
#endif

std::snprintf(strBuf, STR_MAX, P_UINTPTR, options.frontendWinId);
carla_setenv("CARLA_FRONTEND_WIN_ID", strBuf);
carla_setenv("CARLA_SHM_IDS", fShmIds.toRawUTF8());
carla_setenv("LD_LIBRARY_PATH", "/home/falktx/Personal/FOSS/GIT/falkTX/Carla/bin/jack");

started = fProcess->start(arguments);

#ifdef CARLA_OS_LINUX
if (oldPreload != nullptr)
::setenv("LD_PRELOAD", oldPreload, 1);

::unsetenv("LD_LIBRARY_PATH");
#endif
}

if (! started)


+ 8
- 0
source/interposer/libjack.cpp View File

@@ -888,6 +888,14 @@ int jack_client_close(jack_client_t* client)

if (--gClientRefCount == 0)
{
#if 0
static bool ignoreFirstClientClose = true;
if (ignoreFirstClientClose)
{
ignoreFirstClientClose = false;
return 0;
}
#endif
jclient->close();
delete jclient;
gClient = nullptr;


Loading…
Cancel
Save