aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/cubeb_sndio.c
diff options
context:
space:
mode:
authorJan Beich <[email protected]>2019-09-13 02:21:13 +0000
committerMatthew Gregan <[email protected]>2019-09-16 20:12:09 +1200
commit9eb4c89535fdf3726900231a804aa35e19b9f93c (patch)
treec57a644c398e7e9629e9271a645763147b01145e /src/cubeb_sndio.c
parent797779866bee11adb1a0dc323159be2fabe5584e (diff)
downloadcubeb-9eb4c89535fdf3726900231a804aa35e19b9f93c.tar.gz
cubeb-9eb4c89535fdf3726900231a804aa35e19b9f93c.zip
Consistently try loading versioned library first
On Linux dependending on distribution `.so` symlink maybe missing. On OpenBSD `.so.X` symlink is missing unlike `.so` while `.so.X.Y` often changes downstream.
Diffstat (limited to 'src/cubeb_sndio.c')
-rw-r--r--src/cubeb_sndio.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/cubeb_sndio.c b/src/cubeb_sndio.c
index 9ba51b3..4a05bd8 100644
--- a/src/cubeb_sndio.c
+++ b/src/cubeb_sndio.c
@@ -283,10 +283,13 @@ sndio_init(cubeb **context, char const *context_name)
void * libsndio = NULL;
#ifndef DISABLE_LIBSNDIO_DLOPEN
- libsndio = dlopen("libsndio.so", RTLD_LAZY);
+ libsndio = dlopen("libsndio.so.7.0", RTLD_LAZY);
if (!libsndio) {
- DPR("sndio_init(%s) failed dlopen(libsndio.so)\n", context_name);
- return CUBEB_ERROR;
+ libsndio = dlopen("libsndio.so", RTLD_LAZY);
+ if (!libsndio) {
+ DPR("sndio_init(%s) failed dlopen(libsndio.so)\n", context_name);
+ return CUBEB_ERROR;
+ }
}
#define LOAD(x) { \