]> git.alsa-project.org Git - alsa-lib.git/commitdiff
fixed dlopen & co. for hook, ladspa and meter types.
authorTakashi Iwai <tiwai@suse.de>
Mon, 20 Jan 2003 17:15:54 +0000 (17:15 +0000)
committerTakashi Iwai <tiwai@suse.de>
Mon, 20 Jan 2003 17:15:54 +0000 (17:15 +0000)
src/pcm/pcm_hooks.c
src/pcm/pcm_ladspa.c
src/pcm/pcm_meter.c

index 4770fb9a9af561c7eddd3711fb433b5ea56cd41d..a052530000e0db0d093a696b9d1d5a1efe37cbe4 100644 (file)
@@ -517,15 +517,15 @@ static int snd_pcm_hook_add_conf(snd_pcm_t *pcm, snd_config_t *root, snd_config_
                install = buf;
                snprintf(buf, sizeof(buf), "_snd_pcm_hook_%s_install", str);
        }
-       h = dlopen(lib, RTLD_NOW);
-       install_func = h ? dlsym(h, install) : NULL;
+       h = snd_dlopen(lib, RTLD_NOW);
+       install_func = h ? snd_dlsym(h, install, SND_DLSYM_VERSION(SND_PCM_DLSYM_VERSION)) : NULL;
        err = 0;
        if (!h) {
                SNDERR("Cannot open shared library %s", lib);
                err = -ENOENT;
        } else if (!install_func) {
                SNDERR("symbol %s is not defined inside %s", install, lib);
-               dlclose(h);
+               snd_dlclose(h);
                err = -ENXIO;
        }
        _err:
index 0ef781e18f67cfb7559f6a1d4b52759252361941..696203b6af6ab808dca97d8c2145dc132ef31e01 100644 (file)
@@ -156,7 +156,7 @@ static void snd_pcm_ladspa_free_plugins(struct list_head *plugins)
        while (!list_empty(plugins)) {
                snd_pcm_ladspa_plugin_t *plugin = list_entry(plugins->next, snd_pcm_ladspa_plugin_t, list);
                if (plugin->dl_handle)
-                       dlclose(plugin->dl_handle);
+                       snd_dlclose(plugin->dl_handle);
                if (plugin->filename)
                        free(plugin->filename);
                list_del(&plugin->list);
@@ -718,9 +718,9 @@ static int snd_pcm_ladspa_check_file(snd_pcm_ladspa_plugin_t * const plugin,
        void *handle;
 
        assert(filename);
-       handle = dlopen(filename, RTLD_LAZY);
+       handle = snd_dlopen(filename, RTLD_LAZY);
        if (handle) {
-               LADSPA_Descriptor_Function fcn = (LADSPA_Descriptor_Function)dlsym(handle, "ladspa_descriptor");
+               LADSPA_Descriptor_Function fcn = (LADSPA_Descriptor_Function)snd_dlsym(handle, "ladspa_descriptor", SND_DLSYM_VERSION(SND_PCM_DLSYM_VERSION));
                if (fcn) {
                        long idx;
                        const LADSPA_Descriptor *d;
@@ -737,7 +737,7 @@ static int snd_pcm_ladspa_check_file(snd_pcm_ladspa_plugin_t * const plugin,
                                return 1;
                        }
                }
-               dlclose(handle);
+               snd_dlclose(handle);
        }
        return -ENOENT;
 }
index 15b75db11e25695d01b45316ae55c6c630c8a94b..402d0fdf2a05f627f95a281bff3b1b657f2396c6 100644 (file)
@@ -732,15 +732,15 @@ static int snd_pcm_meter_add_scope_conf(snd_pcm_t *pcm, const char *name,
                open_name = buf;
                snprintf(buf, sizeof(buf), "_snd_pcm_scope_%s_open", str);
        }
-       h = dlopen(lib, RTLD_NOW);
-       open_func = h ? dlsym(h, open_name) : NULL;
+       h = snd_dlopen(lib, RTLD_NOW);
+       open_func = h ? snd_dlsym(h, open_name, SND_DLSYM_VERSION(SND_PCM_DLSYM_VERSION)) : NULL;
        err = 0;
        if (!h) {
                SNDERR("Cannot open shared library %s", lib);
                err = -ENOENT;
        } else if (!open_func) {
                SNDERR("symbol %s is not defined inside %s", open_name, lib);
-               dlclose(h);
+               snd_dlclose(h);
                err = -ENXIO;
        }
        _err: