summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2014-09-30 22:56:57 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2014-09-30 22:57:05 -0400
commit3d12a4da82100466f1e5e286260759f07c2e657a (patch)
tree3306cb2ea55b3fed9e645b4bba4fcfd0904c1a76 /libs
parentcd60fd9dfe28d91de9b4b4f261347f25a06c7720 (diff)
fix deep obscure problem with loading multiple backends on OS X
all backends export a symbol declared as "extern "C" ARDOURBACKEND_API ARDOUR::AudioBackendInfo* descriptor ()". dlopen'ing the backend apparently pushes the symbol "descriptor" into the single flat global namespace that we use to be like other unix-like systems. this means that if a backend calls its OWN function named "descriptor", it is indeterminate which one it will be, since the symbol will refer to the function first loaded by the runtime linker. If the backend is not the first one discovered, this call to its own "descriptor" function will invoke the function defined by another backend, even though these are supposed to have local scope only according to our arguments to dlopen(). This fix doesn't try to fix the linker or namespace - it just makes sure that the WavesAudio backend doesn't invoke its own descriptor() function, which it never really needed to do anyway.
Diffstat (limited to 'libs')
-rw-r--r--libs/backends/wavesaudio/waves_audiobackend.cc6
-rw-r--r--libs/backends/wavesaudio/waves_audiobackend.h2
2 files changed, 4 insertions, 4 deletions
diff --git a/libs/backends/wavesaudio/waves_audiobackend.cc b/libs/backends/wavesaudio/waves_audiobackend.cc
index e231dc698d..0da28944de 100644
--- a/libs/backends/wavesaudio/waves_audiobackend.cc
+++ b/libs/backends/wavesaudio/waves_audiobackend.cc
@@ -97,8 +97,8 @@ void WavesAudioBackend::AudioDeviceManagerNotification (NotificationReason reaso
}
-WavesAudioBackend::WavesAudioBackend (AudioEngine& e, AudioBackendInfo& info)
- : AudioBackend (e, info)
+WavesAudioBackend::WavesAudioBackend (AudioEngine& e)
+ : AudioBackend (e, __backend_info)
, _audio_device_manager (this)
, _midi_device_manager (*this)
, _device (NULL)
@@ -1201,7 +1201,7 @@ WavesAudioBackend::__waves_backend_factory (AudioEngine& e)
{
// COMMENTED DBG LOGS */ std::cout << "WavesAudioBackend::__waves_backend_factory ():" << std::endl;
if (!__instance) {
- __instance.reset (new WavesAudioBackend (e, *(descriptor())));
+ __instance.reset (new WavesAudioBackend (e));
}
return __instance;
}
diff --git a/libs/backends/wavesaudio/waves_audiobackend.h b/libs/backends/wavesaudio/waves_audiobackend.h
index a97bd957bd..0f384b746d 100644
--- a/libs/backends/wavesaudio/waves_audiobackend.h
+++ b/libs/backends/wavesaudio/waves_audiobackend.h
@@ -70,7 +70,7 @@ class WavesMidiPort;
class WavesAudioBackend : public AudioBackend, WCMRAudioDeviceManagerClient
{
public:
- WavesAudioBackend (AudioEngine& e, AudioBackendInfo&);
+ WavesAudioBackend (AudioEngine& e);
virtual ~WavesAudioBackend ();
/* AUDIOBACKEND API */