diff options
Diffstat (limited to 'src/pcm')
-rw-r--r-- | src/pcm/pcm.c | 25 | ||||
-rw-r--r-- | src/pcm/pcm_adpcm.c | 1 | ||||
-rw-r--r-- | src/pcm/pcm_alaw.c | 1 | ||||
-rw-r--r-- | src/pcm/pcm_copy.c | 1 | ||||
-rw-r--r-- | src/pcm/pcm_file.c | 1 | ||||
-rw-r--r-- | src/pcm/pcm_hooks.c | 3 | ||||
-rw-r--r-- | src/pcm/pcm_hw.c | 1 | ||||
-rw-r--r-- | src/pcm/pcm_linear.c | 1 | ||||
-rw-r--r-- | src/pcm/pcm_meter.c | 3 | ||||
-rw-r--r-- | src/pcm/pcm_mulaw.c | 1 | ||||
-rw-r--r-- | src/pcm/pcm_multi.c | 1 | ||||
-rw-r--r-- | src/pcm/pcm_null.c | 1 | ||||
-rw-r--r-- | src/pcm/pcm_plug.c | 1 | ||||
-rw-r--r-- | src/pcm/pcm_rate.c | 1 | ||||
-rw-r--r-- | src/pcm/pcm_route.c | 1 | ||||
-rw-r--r-- | src/pcm/pcm_share.c | 1 | ||||
-rw-r--r-- | src/pcm/pcm_shm.c | 1 |
17 files changed, 24 insertions, 21 deletions
diff --git a/src/pcm/pcm.c b/src/pcm/pcm.c index e6d98916..2a53b234 100644 --- a/src/pcm/pcm.c +++ b/src/pcm/pcm.c @@ -1056,10 +1056,14 @@ static int snd_pcm_open_conf(snd_pcm_t **pcmp, const char *name, open_name = buf; snprintf(buf, sizeof(buf), "_snd_pcm_%s_open", str); } - if (!lib) - lib = ALSA_LIB; h = dlopen(lib, RTLD_NOW); - open_func = h ? dlsym(h, open_name) : NULL; + if (h) { + if ((err = snd_dlsym_verify(h, open_name, SND_DLSYM_VERSION(SND_PCM_DLSYM_VERSION))) < 0) { + dlclose(h); + goto _err; + } + open_func = dlsym(h, open_name); + } err = 0; if (!h) { SNDERR("Cannot open shared library %s", lib); @@ -1079,25 +1083,12 @@ static int snd_pcm_open_noupdate(snd_pcm_t **pcmp, snd_config_t *root, const char *name, snd_pcm_stream_t stream, int mode) { int err; - snd_config_t *pcm_conf, *n; + snd_config_t *pcm_conf; err = snd_config_search_definition(root, "pcm", name, &pcm_conf); if (err < 0) { SNDERR("Unknown PCM %s", name); return err; } - if (snd_config_search(pcm_conf, "refer", &n) >= 0) { - snd_config_t *refer; - char *new_name; - err = snd_config_refer_load(&refer, &new_name, root, n); - if (err < 0) { - SNDERR("Unable to load refered block in PCM %s: %s", name, snd_strerror(err)); - return err; - } - err = snd_pcm_open_noupdate(pcmp, refer, new_name, stream, mode); - if (refer != root) - snd_config_delete(refer); - return err; - } err = snd_pcm_open_conf(pcmp, name, root, pcm_conf, stream, mode); snd_config_delete(pcm_conf); return err; diff --git a/src/pcm/pcm_adpcm.c b/src/pcm/pcm_adpcm.c index b8f06112..2b43154d 100644 --- a/src/pcm/pcm_adpcm.c +++ b/src/pcm/pcm_adpcm.c @@ -541,6 +541,7 @@ int snd_pcm_adpcm_open(snd_pcm_t **pcmp, const char *name, snd_pcm_format_t sfor return 0; } +SND_DLSYM_BUILD_VERSION(_snd_pcm_adpcm_open, SND_PCM_DLSYM_VERSION); int _snd_pcm_adpcm_open(snd_pcm_t **pcmp, const char *name, snd_config_t *root, snd_config_t *conf, snd_pcm_stream_t stream, int mode) diff --git a/src/pcm/pcm_alaw.c b/src/pcm/pcm_alaw.c index 230bf947..dd1e9d9b 100644 --- a/src/pcm/pcm_alaw.c +++ b/src/pcm/pcm_alaw.c @@ -414,6 +414,7 @@ int snd_pcm_alaw_open(snd_pcm_t **pcmp, const char *name, snd_pcm_format_t sform return 0; } +SND_DLSYM_BUILD_VERSION(_snd_pcm_alaw_open, SND_PCM_DLSYM_VERSION); int _snd_pcm_alaw_open(snd_pcm_t **pcmp, const char *name, snd_config_t *root, snd_config_t *conf, snd_pcm_stream_t stream, int mode) diff --git a/src/pcm/pcm_copy.c b/src/pcm/pcm_copy.c index 8c6b4863..796b7633 100644 --- a/src/pcm/pcm_copy.c +++ b/src/pcm/pcm_copy.c @@ -184,6 +184,7 @@ int snd_pcm_copy_open(snd_pcm_t **pcmp, const char *name, snd_pcm_t *slave, int return 0; } +SND_DLSYM_BUILD_VERSION(_snd_pcm_copy_open, SND_PCM_DLSYM_VERSION); int _snd_pcm_copy_open(snd_pcm_t **pcmp, const char *name, snd_config_t *root, snd_config_t *conf, snd_pcm_stream_t stream, int mode) diff --git a/src/pcm/pcm_file.c b/src/pcm/pcm_file.c index 66971124..cbd0fdb1 100644 --- a/src/pcm/pcm_file.c +++ b/src/pcm/pcm_file.c @@ -449,6 +449,7 @@ int snd_pcm_file_open(snd_pcm_t **pcmp, const char *name, const char *fname, int return 0; } +SND_DLSYM_BUILD_VERSION(_snd_pcm_file_open, SND_PCM_DLSYM_VERSION); int _snd_pcm_file_open(snd_pcm_t **pcmp, const char *name, snd_config_t *root, snd_config_t *conf, snd_pcm_stream_t stream, int mode) diff --git a/src/pcm/pcm_hooks.c b/src/pcm/pcm_hooks.c index 49a59c1d..98879465 100644 --- a/src/pcm/pcm_hooks.c +++ b/src/pcm/pcm_hooks.c @@ -394,8 +394,6 @@ 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); } - if (!lib) - lib = ALSA_LIB; h = dlopen(lib, RTLD_NOW); install_func = h ? dlsym(h, install) : NULL; err = 0; @@ -425,6 +423,7 @@ static int snd_pcm_hook_add_conf(snd_pcm_t *pcm, snd_config_t *root, snd_config_ return 0; } +SND_DLSYM_BUILD_VERSION(_snd_pcm_hooks_open, SND_PCM_DLSYM_VERSION); int _snd_pcm_hooks_open(snd_pcm_t **pcmp, const char *name, snd_config_t *root, snd_config_t *conf, snd_pcm_stream_t stream, int mode) diff --git a/src/pcm/pcm_hw.c b/src/pcm/pcm_hw.c index 327aad2a..adab12c5 100644 --- a/src/pcm/pcm_hw.c +++ b/src/pcm/pcm_hw.c @@ -640,6 +640,7 @@ int snd_pcm_hw_open(snd_pcm_t **pcmp, const char *name, int card, int device, in return ret; } +SND_DLSYM_BUILD_VERSION(_snd_pcm_hw_open, SND_PCM_DLSYM_VERSION); int _snd_pcm_hw_open(snd_pcm_t **pcmp, const char *name, snd_config_t *root ATTRIBUTE_UNUSED, snd_config_t *conf, snd_pcm_stream_t stream, int mode) diff --git a/src/pcm/pcm_linear.c b/src/pcm/pcm_linear.c index 6bbe90fe..3b4a68dc 100644 --- a/src/pcm/pcm_linear.c +++ b/src/pcm/pcm_linear.c @@ -319,6 +319,7 @@ int snd_pcm_linear_open(snd_pcm_t **pcmp, const char *name, snd_pcm_format_t sfo return 0; } +SND_DLSYM_BUILD_VERSION(_snd_pcm_linear_open, SND_PCM_DLSYM_VERSION); int _snd_pcm_linear_open(snd_pcm_t **pcmp, const char *name, snd_config_t *root, snd_config_t *conf, snd_pcm_stream_t stream, int mode) diff --git a/src/pcm/pcm_meter.c b/src/pcm/pcm_meter.c index 0b1c49d9..01b2868c 100644 --- a/src/pcm/pcm_meter.c +++ b/src/pcm/pcm_meter.c @@ -704,8 +704,6 @@ 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); } - if (!lib) - lib = ALSA_LIB; h = dlopen(lib, RTLD_NOW); open_func = h ? dlsym(h, open_name) : NULL; err = 0; @@ -724,6 +722,7 @@ static int snd_pcm_meter_add_scope_conf(snd_pcm_t *pcm, const char *name, } +SND_DLSYM_BUILD_VERSION(_snd_pcm_meter_open, SND_PCM_DLSYM_VERSION); int _snd_pcm_meter_open(snd_pcm_t **pcmp, const char *name, snd_config_t *root, snd_config_t *conf, snd_pcm_stream_t stream, int mode) diff --git a/src/pcm/pcm_mulaw.c b/src/pcm/pcm_mulaw.c index a8a32efa..620d7ac7 100644 --- a/src/pcm/pcm_mulaw.c +++ b/src/pcm/pcm_mulaw.c @@ -429,6 +429,7 @@ int snd_pcm_mulaw_open(snd_pcm_t **pcmp, const char *name, snd_pcm_format_t sfor return 0; } +SND_DLSYM_BUILD_VERSION(_snd_pcm_mulaw_open, SND_PCM_DLSYM_VERSION); int _snd_pcm_mulaw_open(snd_pcm_t **pcmp, const char *name, snd_config_t *root, snd_config_t *conf, snd_pcm_stream_t stream, int mode) diff --git a/src/pcm/pcm_multi.c b/src/pcm/pcm_multi.c index de59198b..a8a5003b 100644 --- a/src/pcm/pcm_multi.c +++ b/src/pcm/pcm_multi.c @@ -643,6 +643,7 @@ int snd_pcm_multi_open(snd_pcm_t **pcmp, const char *name, return 0; } +SND_DLSYM_BUILD_VERSION(_snd_pcm_multi_open, SND_PCM_DLSYM_VERSION); int _snd_pcm_multi_open(snd_pcm_t **pcmp, const char *name, snd_config_t *root, snd_config_t *conf, snd_pcm_stream_t stream, int mode) diff --git a/src/pcm/pcm_null.c b/src/pcm/pcm_null.c index 0e6a3c63..6360be38 100644 --- a/src/pcm/pcm_null.c +++ b/src/pcm/pcm_null.c @@ -358,6 +358,7 @@ int snd_pcm_null_open(snd_pcm_t **pcmp, const char *name, snd_pcm_stream_t strea return 0; } +SND_DLSYM_BUILD_VERSION(_snd_pcm_null_open, SND_PCM_DLSYM_VERSION); int _snd_pcm_null_open(snd_pcm_t **pcmp, const char *name, snd_config_t *conf, snd_pcm_stream_t stream, int mode) diff --git a/src/pcm/pcm_plug.c b/src/pcm/pcm_plug.c index 7463b600..1ee99496 100644 --- a/src/pcm/pcm_plug.c +++ b/src/pcm/pcm_plug.c @@ -771,6 +771,7 @@ int snd_pcm_plug_open(snd_pcm_t **pcmp, #define MAX_CHANNELS 64 +SND_DLSYM_BUILD_VERSION(_snd_pcm_plug_open, SND_PCM_DLSYM_VERSION); int _snd_pcm_plug_open(snd_pcm_t **pcmp, const char *name, snd_config_t *root, snd_config_t *conf, snd_pcm_stream_t stream, int mode) diff --git a/src/pcm/pcm_rate.c b/src/pcm/pcm_rate.c index fd8030c7..8aee1517 100644 --- a/src/pcm/pcm_rate.c +++ b/src/pcm/pcm_rate.c @@ -528,6 +528,7 @@ int snd_pcm_rate_open(snd_pcm_t **pcmp, const char *name, snd_pcm_format_t sform return 0; } +SND_DLSYM_BUILD_VERSION(_snd_pcm_rate_open, SND_PCM_DLSYM_VERSION); int _snd_pcm_rate_open(snd_pcm_t **pcmp, const char *name, snd_config_t *root, snd_config_t *conf, snd_pcm_stream_t stream, int mode) diff --git a/src/pcm/pcm_route.c b/src/pcm/pcm_route.c index 776e1500..a229cb0c 100644 --- a/src/pcm/pcm_route.c +++ b/src/pcm/pcm_route.c @@ -833,6 +833,7 @@ int snd_pcm_route_load_ttable(snd_config_t *tt, snd_pcm_route_ttable_entry_t *tt #define MAX_CHANNELS 32 +SND_DLSYM_BUILD_VERSION(_snd_pcm_route_open, SND_PCM_DLSYM_VERSION); int _snd_pcm_route_open(snd_pcm_t **pcmp, const char *name, snd_config_t *root, snd_config_t *conf, snd_pcm_stream_t stream, int mode) diff --git a/src/pcm/pcm_share.c b/src/pcm/pcm_share.c index 529fad16..65fab30e 100644 --- a/src/pcm/pcm_share.c +++ b/src/pcm/pcm_share.c @@ -1359,6 +1359,7 @@ int snd_pcm_share_open(snd_pcm_t **pcmp, const char *name, const char *sname, return 0; } +SND_DLSYM_BUILD_VERSION(_snd_pcm_share_open, SND_PCM_DLSYM_VERSION); int _snd_pcm_share_open(snd_pcm_t **pcmp, const char *name, snd_config_t *root, snd_config_t *conf, snd_pcm_stream_t stream, int mode) diff --git a/src/pcm/pcm_shm.c b/src/pcm/pcm_shm.c index bdba9215..0b1770c5 100644 --- a/src/pcm/pcm_shm.c +++ b/src/pcm/pcm_shm.c @@ -710,6 +710,7 @@ int is_local(struct hostent *hent) return i < numreqs; } +SND_DLSYM_BUILD_VERSION(_snd_pcm_shm_open, SND_PCM_DLSYM_VERSION); int _snd_pcm_shm_open(snd_pcm_t **pcmp, const char *name, snd_config_t *root, snd_config_t *conf, snd_pcm_stream_t stream, int mode) |