Browse Source

prepare for libsndfile mp3

master
Alexandros Theodotou 7 months ago
parent
commit
e1003934f0
Signed by: alex
GPG Key ID: 022EAE42313D70F3
  1. 6
      meson.build
  2. 2
      src/ad_minimp3.c
  3. 3
      src/ad_soundfile.c

6
meson.build

@ -163,6 +163,12 @@ if not sndfile_dep.found () @@ -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 (

2
src/ad_minimp3.c

@ -177,7 +177,7 @@ static int ad_eval_minimp3(const char *f) @@ -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;
}

3
src/ad_soundfile.c

@ -161,6 +161,9 @@ static int ad_eval_sndfile(const char *f) { @@ -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;
}

Loading…
Cancel
Save