From a225f5d167ec125eddd194dd03c0d3384f1e87ba Mon Sep 17 00:00:00 2001 From: sletz Date: Tue, 11 Mar 2008 12:15:48 +0000 Subject: [PATCH] Use jack_client_open_aux function git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@1941 0c269be4-1314-0410-8aa9-9f06e86f4224 --- common/JackAPIWrapper.cpp | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/common/JackAPIWrapper.cpp b/common/JackAPIWrapper.cpp index 4c406aac..3384b742 100644 --- a/common/JackAPIWrapper.cpp +++ b/common/JackAPIWrapper.cpp @@ -993,20 +993,33 @@ EXPORT jack_status_t jack_internal_client_unload(jack_client_t* ext_client, jack } -typedef jack_client_t * (*jack_client_open_fun_def)(const char *client_name, jack_options_t options, jack_status_t *status, ...); -static jack_client_open_fun_def jack_client_open_fun = 0; +typedef jack_client_t * (*jack_client_open_aux_fun_def)(const char *client_name, jack_options_t options, jack_status_t *status, va_list ap); +static jack_client_open_aux_fun_def jack_client_open_aux_fun = 0; EXPORT jack_client_t * jack_client_open(const char *client_name, jack_options_t options, jack_status_t *status, ...) { // TODO : in "autostart mode", has to load jackdrc file and figure out which server has to be started... jack_log("jack_client_open"); + /* + va_list ap; + va_start (ap, status); + + if (try_start_server(&va, options, status)) { + jack_error("jack server is not running or cannot be started"); + JackLibGlobals::Destroy(); // jack library destruction + return 0; + } + + va_end (ap); + */ + // Library check... if (!open_library()) return 0; va_list ap; va_start(ap, status); - jack_client_t* res = (*jack_client_open_fun)(client_name, options, status, ap); + jack_client_t* res = (*jack_client_open_aux_fun)(client_name, options, status, ap); va_end(ap); return res; } @@ -1088,7 +1101,7 @@ static bool check_client(void* library) printf("check_library\n"); - // Get "new", "open" 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_close_fun = (jack_client_close_fun_def)dlsym(library, "jack_client_close"); @@ -1144,7 +1157,7 @@ static bool init_library() } // Load entry points... - jack_client_open_fun = (jack_client_open_fun_def)dlsym(gLibrary, "jack_client_open"); + jack_client_open_aux_fun = (jack_client_open_aux_fun_def)dlsym(gLibrary, "jack_client_open_aux"); jack_client_new_fun = (jack_client_new_fun_def)dlsym(gLibrary, "jack_client_new"); jack_client_close_fun = (jack_client_close_fun_def)dlsym(gLibrary, "jack_client_close"); jack_client_name_size_fun = (jack_client_name_size_fun_def)dlsym(gLibrary, "jack_client_name_size");