Audapsace: Make it work with Jack and no libjack-dev package installed

@neXyon, mind backporting it to your upstream? :)
This commit is contained in:
Sergey Sharybin 2016-08-01 20:39:54 +02:00
parent 8e015e30b5
commit 538b30250d
1 changed files with 14 additions and 1 deletions

View File

@ -44,7 +44,20 @@ static bool jack_supported = false;
void AUD_jack_init(void)
{
#ifdef WITH_JACK_DYNLOAD
jack_handle = dlopen("libjack.so", RTLD_LAZY);
const char *names[] = {"libjack.so",
"libjack.so.0",
"libjack.so.1",
"libjack.so.2",
NULL};
int index = 0;
while (names[index] != NULL) {
jack_handle = dlopen(names[index], RTLD_LAZY);
if (jack_handle != NULL) {
// Found existing library.
break;
}
++index;
}
if (!jack_handle) {
return;