Browse Source

Cleanup

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@1952 0c269be4-1314-0410-8aa9-9f06e86f4224
tags/0.71
sletz 17 years ago
parent
commit
c59992f881
1 changed files with 7 additions and 19 deletions
  1. +7
    -19
      common/JackAPIWrapper.cpp

+ 7
- 19
common/JackAPIWrapper.cpp View File

@@ -210,9 +210,7 @@ extern "C"
#define JACKMP_LIB "libjackmp.so" #define JACKMP_LIB "libjackmp.so"


// client // client
static bool gInitedLib = false;
static void* gLibrary = 0; static void* gLibrary = 0;
static bool init_library();
static bool open_library(); static bool open_library();
static void close_library(); static void close_library();


@@ -1077,29 +1075,19 @@ static bool get_jack_library(const char* library_name, char* library_res_name)
return false; return false;
} }


static bool open_library()
{
jack_log("open_library %ld", gInitedLib);
if (!gInitedLib)
gInitedLib = init_library();
return gInitedLib;
}

static void close_library() static void close_library()
{ {
jack_log("close_library"); jack_log("close_library");
if (gInitedLib) {
if (gLibrary) {
dlclose(gLibrary); dlclose(gLibrary);
gLibrary = 0; gLibrary = 0;
gInitedLib = false;
}
}
} }


static bool check_client(void* library) static bool check_client(void* library)
{ {
jack_client_t* client = 0; jack_client_t* client = 0;

jack_log("check_library");
jack_log("check_client");


// Get "new" and "close" entry points... // Get "new" and "close" entry points...
jack_client_new_fun = (jack_client_new_fun_def)dlsym(library, "jack_client_new"); jack_client_new_fun = (jack_client_new_fun_def)dlsym(library, "jack_client_new");
@@ -1107,17 +1095,17 @@ static bool check_client(void* library)
// Try opening a client... // Try opening a client...
if ((client = (*jack_client_new_fun)("dummy"))) { // server is running.... if ((client = (*jack_client_new_fun)("dummy"))) { // server is running....
jack_log("check_library 1 %x", jack_client_close_fun);
jack_log("check_client 1 %x", jack_client_close_fun);
(*jack_client_close_fun)(client); (*jack_client_close_fun)(client);
jack_log("check_library 2");
jack_log("check_client 2");
return true; return true;
} else { } else {
jack_log("check_library NO");
jack_log("check_client NO");
return false; return false;
} }
} }


static bool init_library()
static bool open_library()
{ {
char library_res_name[256]; char library_res_name[256];
void* jackLibrary = (get_jack_library(JACK_LIB, library_res_name)) ? dlopen(library_res_name, RTLD_LAZY) : 0; void* jackLibrary = (get_jack_library(JACK_LIB, library_res_name)) ? dlopen(library_res_name, RTLD_LAZY) : 0;


Loading…
Cancel
Save