summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsletz <sletz@0c269be4-1314-0410-8aa9-9f06e86f4224>2011-11-03 09:29:03 +0000
committersletz <sletz@0c269be4-1314-0410-8aa9-9f06e86f4224>2011-11-03 09:29:03 +0000
commit7b92e2e6ee56f5d271b07b1472461da43806519a (patch)
tree441aeb44cb45a39148141aa7e68ba982e459a683
parent48815285d573b50c207028115aed4f776128d192 (diff)
downloadjack2-7b92e2e6ee56f5d271b07b1472461da43806519a.tar.gz
John Emmas Windows server launching patch (1).
git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@4559 0c269be4-1314-0410-8aa9-9f06e86f4224
-rw-r--r--ChangeLog1
-rw-r--r--common/JackDriverLoader.cpp41
-rw-r--r--common/shm.c4
3 files changed, 38 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 90ab0dfc..ac8c42e4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -39,6 +39,7 @@ John Emmas
2011-11-03 Stephane Letz <letz@grame.fr>
* Add missing jack_client_get_uuid API.
+ * John Emmas Windows server launching patch (1).
2011-10-28 Stephane Letz <letz@grame.fr>
diff --git a/common/JackDriverLoader.cpp b/common/JackDriverLoader.cpp
index b3eaf076..3f7d9283 100644
--- a/common/JackDriverLoader.cpp
+++ b/common/JackDriverLoader.cpp
@@ -25,6 +25,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#include <getopt.h>
#include <stdio.h>
#include <errno.h>
+#include <string.h>
#ifndef WIN32
#include <dirent.h>
@@ -393,7 +394,15 @@ jack_get_descriptor (JSList * drivers, const char * sofile, const char * symbol)
#ifdef WIN32
char temp_driver_dir1[512];
char temp_driver_dir2[512];
- GetCurrentDirectory(512, temp_driver_dir1);
+ if (3 < GetModuleFileName(NULL, temp_driver_dir1, 512)) {
+ char *p = strrchr(temp_driver_dir1, '\\');
+ if (p && (p != temp_driver_dir1))
+ *p = 0;
+ else
+ GetCurrentDirectory(512, temp_driver_dir1);
+ } else {
+ GetCurrentDirectory(512, temp_driver_dir1);
+ }
sprintf(temp_driver_dir2, "%s/%s", temp_driver_dir1, ADDON_DIR);
driver_dir = temp_driver_dir2;
#else
@@ -477,7 +486,15 @@ static bool check_symbol(const char* sofile, const char* symbol)
#ifdef WIN32
char temp_driver_dir1[512];
char temp_driver_dir2[512];
- GetCurrentDirectory(512, temp_driver_dir1);
+ if (3 < GetModuleFileName(NULL, temp_driver_dir1, 512)) {
+ char *p = strrchr(temp_driver_dir1, '\\');
+ if (p && (p != temp_driver_dir1))
+ *p = 0;
+ else
+ GetCurrentDirectory(512, temp_driver_dir1);
+ } else {
+ GetCurrentDirectory(512, temp_driver_dir1);
+ }
sprintf(temp_driver_dir2, "%s/%s", temp_driver_dir1, ADDON_DIR);
driver_dir = temp_driver_dir2;
#else
@@ -518,7 +535,15 @@ jack_drivers_load (JSList * drivers) {
if ((driver_dir = getenv("JACK_DRIVER_DIR")) == 0) {
// for WIN32 ADDON_DIR is defined in JackConstants.h as relative path
- GetCurrentDirectory(512, driver_dir_storage);
+ if (3 < GetModuleFileName(NULL, driver_dir_storage, 512)) {
+ char *p = strrchr(driver_dir_storage, '\\');
+ if (p && (p != driver_dir_storage))
+ *p = 0;
+ else
+ GetCurrentDirectory(512, driver_dir_storage);
+ } else {
+ GetCurrentDirectory(512, driver_dir_storage);
+ }
strcat(driver_dir_storage, "/");
strcat(driver_dir_storage, ADDON_DIR);
driver_dir = driver_dir_storage;
@@ -655,7 +680,15 @@ jack_internals_load (JSList * internals) {
if ((driver_dir = getenv("JACK_DRIVER_DIR")) == 0) {
// for WIN32 ADDON_DIR is defined in JackConstants.h as relative path
- GetCurrentDirectory(512, driver_dir_storage);
+ if (3 < GetModuleFileName(NULL, driver_dir_storage, 512)) {
+ char *p = strrchr(driver_dir_storage, '\\');
+ if (p && (p != driver_dir_storage))
+ *p = 0;
+ else
+ GetCurrentDirectory(512, driver_dir_storage);
+ } else {
+ GetCurrentDirectory(512, driver_dir_storage);
+ }
strcat(driver_dir_storage, "/");
strcat(driver_dir_storage, ADDON_DIR);
driver_dir = driver_dir_storage;
diff --git a/common/shm.c b/common/shm.c
index a4605162..f4543b2d 100644
--- a/common/shm.c
+++ b/common/shm.c
@@ -503,8 +503,6 @@ jack_register_server (const char *server_name, int new_registry)
*/
for (i = 0; i < MAX_SERVERS; i++) {
- printf("server name %s %s\n", jack_shm_header->server[i].name, jack_shm_server_prefix);
-
if (strncmp (jack_shm_header->server[i].name,
jack_shm_server_prefix,
JACK_SERVER_NAME_SIZE) != 0)
@@ -550,8 +548,6 @@ jack_register_server (const char *server_name, int new_registry)
jack_shm_server_prefix,
JACK_SERVER_NAME_SIZE);
- printf("new server name %s \n", jack_shm_header->server[i].name);
-
unlock:
jack_shm_unlock_registry ();
return res;