mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-31 22:25:35 -04:00
fixed dlopen & co. for hook, ladspa and meter types.
This commit is contained in:
parent
a8a71d5781
commit
2dc8cba51c
3 changed files with 10 additions and 10 deletions
|
|
@ -517,15 +517,15 @@ static int snd_pcm_hook_add_conf(snd_pcm_t *pcm, snd_config_t *root, snd_config_
|
||||||
install = buf;
|
install = buf;
|
||||||
snprintf(buf, sizeof(buf), "_snd_pcm_hook_%s_install", str);
|
snprintf(buf, sizeof(buf), "_snd_pcm_hook_%s_install", str);
|
||||||
}
|
}
|
||||||
h = dlopen(lib, RTLD_NOW);
|
h = snd_dlopen(lib, RTLD_NOW);
|
||||||
install_func = h ? dlsym(h, install) : NULL;
|
install_func = h ? snd_dlsym(h, install, SND_DLSYM_VERSION(SND_PCM_DLSYM_VERSION)) : NULL;
|
||||||
err = 0;
|
err = 0;
|
||||||
if (!h) {
|
if (!h) {
|
||||||
SNDERR("Cannot open shared library %s", lib);
|
SNDERR("Cannot open shared library %s", lib);
|
||||||
err = -ENOENT;
|
err = -ENOENT;
|
||||||
} else if (!install_func) {
|
} else if (!install_func) {
|
||||||
SNDERR("symbol %s is not defined inside %s", install, lib);
|
SNDERR("symbol %s is not defined inside %s", install, lib);
|
||||||
dlclose(h);
|
snd_dlclose(h);
|
||||||
err = -ENXIO;
|
err = -ENXIO;
|
||||||
}
|
}
|
||||||
_err:
|
_err:
|
||||||
|
|
|
||||||
|
|
@ -156,7 +156,7 @@ static void snd_pcm_ladspa_free_plugins(struct list_head *plugins)
|
||||||
while (!list_empty(plugins)) {
|
while (!list_empty(plugins)) {
|
||||||
snd_pcm_ladspa_plugin_t *plugin = list_entry(plugins->next, snd_pcm_ladspa_plugin_t, list);
|
snd_pcm_ladspa_plugin_t *plugin = list_entry(plugins->next, snd_pcm_ladspa_plugin_t, list);
|
||||||
if (plugin->dl_handle)
|
if (plugin->dl_handle)
|
||||||
dlclose(plugin->dl_handle);
|
snd_dlclose(plugin->dl_handle);
|
||||||
if (plugin->filename)
|
if (plugin->filename)
|
||||||
free(plugin->filename);
|
free(plugin->filename);
|
||||||
list_del(&plugin->list);
|
list_del(&plugin->list);
|
||||||
|
|
@ -718,9 +718,9 @@ static int snd_pcm_ladspa_check_file(snd_pcm_ladspa_plugin_t * const plugin,
|
||||||
void *handle;
|
void *handle;
|
||||||
|
|
||||||
assert(filename);
|
assert(filename);
|
||||||
handle = dlopen(filename, RTLD_LAZY);
|
handle = snd_dlopen(filename, RTLD_LAZY);
|
||||||
if (handle) {
|
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) {
|
if (fcn) {
|
||||||
long idx;
|
long idx;
|
||||||
const LADSPA_Descriptor *d;
|
const LADSPA_Descriptor *d;
|
||||||
|
|
@ -737,7 +737,7 @@ static int snd_pcm_ladspa_check_file(snd_pcm_ladspa_plugin_t * const plugin,
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dlclose(handle);
|
snd_dlclose(handle);
|
||||||
}
|
}
|
||||||
return -ENOENT;
|
return -ENOENT;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -732,15 +732,15 @@ static int snd_pcm_meter_add_scope_conf(snd_pcm_t *pcm, const char *name,
|
||||||
open_name = buf;
|
open_name = buf;
|
||||||
snprintf(buf, sizeof(buf), "_snd_pcm_scope_%s_open", str);
|
snprintf(buf, sizeof(buf), "_snd_pcm_scope_%s_open", str);
|
||||||
}
|
}
|
||||||
h = dlopen(lib, RTLD_NOW);
|
h = snd_dlopen(lib, RTLD_NOW);
|
||||||
open_func = h ? dlsym(h, open_name) : NULL;
|
open_func = h ? snd_dlsym(h, open_name, SND_DLSYM_VERSION(SND_PCM_DLSYM_VERSION)) : NULL;
|
||||||
err = 0;
|
err = 0;
|
||||||
if (!h) {
|
if (!h) {
|
||||||
SNDERR("Cannot open shared library %s", lib);
|
SNDERR("Cannot open shared library %s", lib);
|
||||||
err = -ENOENT;
|
err = -ENOENT;
|
||||||
} else if (!open_func) {
|
} else if (!open_func) {
|
||||||
SNDERR("symbol %s is not defined inside %s", open_name, lib);
|
SNDERR("symbol %s is not defined inside %s", open_name, lib);
|
||||||
dlclose(h);
|
snd_dlclose(h);
|
||||||
err = -ENXIO;
|
err = -ENXIO;
|
||||||
}
|
}
|
||||||
_err:
|
_err:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue