diff --git a/meson.build b/meson.build index bd594f8..f1239f6 100644 --- a/meson.build +++ b/meson.build @@ -163,6 +163,12 @@ if not sndfile_dep.found () sndfile_dep = sndfile_subproject.dependency ( 'sndfile') endif +# this is not enough - need to check dependencies for +# libmp3lame because most distros build without it +if sndfile_dep.version ().version_compare ('>=1.1.0') and false + cdata.set ( + 'LIBSNDFILE_HAVE_MP3', 0) +endif # Maths functions might be implemented in libm libm = cc.find_library ( diff --git a/src/ad_minimp3.c b/src/ad_minimp3.c index 498bf61..b42124b 100644 --- a/src/ad_minimp3.c +++ b/src/ad_minimp3.c @@ -177,7 +177,7 @@ static int ad_eval_minimp3(const char *f) char *ext = strrchr(f, '.'); if (strstr (f, "://")) return 0; if (!ext) return 5; - if (!strcasecmp(ext, ".mp3")) return 100; + if (!strcasecmp(ext, ".mp3")) return 50; return 0; } diff --git a/src/ad_soundfile.c b/src/ad_soundfile.c index e040973..5da5b9e 100644 --- a/src/ad_soundfile.c +++ b/src/ad_soundfile.c @@ -161,6 +161,9 @@ static int ad_eval_sndfile(const char *f) { // libsndfile >= 1.0.18 if (!strcasecmp(ext, ".flac")) return 80; if (!strcasecmp(ext, ".ogg")) return 80; +#ifdef LIBSNDFILE_HAVE_MP3 + if (!strcasecmp(ext, ".mp3")) return 80; +#endif return 0; }