[Bf-blender-cvs] [36f511f] fracture_modifier: small fix for loading possibly different jack shared library versions on different linux distributions, thanks to sergey for the fix

Martin Felke noreply at git.blender.org
Tue Aug 2 15:54:18 CEST 2016


Commit: 36f511f9c31162bac6a1f87ce602cba065f2c135
Author: Martin Felke
Date:   Tue Aug 2 15:53:29 2016 +0200
Branches: fracture_modifier
https://developer.blender.org/rB36f511f9c31162bac6a1f87ce602cba065f2c135

small fix for loading possibly different jack shared library versions on different linux distributions, thanks to sergey for the fix

===================================================================

M	intern/audaspace/jack/AUD_JackLibrary.cpp

===================================================================

diff --git a/intern/audaspace/jack/AUD_JackLibrary.cpp b/intern/audaspace/jack/AUD_JackLibrary.cpp
index 63306ee..9ed6862 100644
--- a/intern/audaspace/jack/AUD_JackLibrary.cpp
+++ b/intern/audaspace/jack/AUD_JackLibrary.cpp
@@ -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;




More information about the Bf-blender-cvs mailing list