From 104b21f2278e70a7fd005fbf7a1d4fd360743b7c Mon Sep 17 00:00:00 2001 From: Arnaud Rebillout Date: Sun, 21 Oct 2018 17:00:25 +0700 Subject: [PATCH] meson: Add optional libsamplerate support Signed-off-by: Arnaud Rebillout --- meson.build | 5 +++++ meson_options.txt | 3 +++ src/pulsecore/meson.build | 6 +++++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 41442767b..5919fefa6 100644 --- a/meson.build +++ b/meson.build @@ -252,6 +252,11 @@ if gtk_dep.found() cdata.set('HAVE_GTK', 1) endif +samplerate_dep = dependency('samplerate', version : '>= 0.1.0', required : get_option('samplerate')) +if samplerate_dep.found() + cdata.set('HAVE_LIBSAMPLERATE', 1) +endif + soxr_dep = dependency('soxr', version : '>= 0.1.1', required : get_option('soxr')) if soxr_dep.found() cdata.set('HAVE_SOXR', 1) diff --git a/meson_options.txt b/meson_options.txt index fba85fa76..7537d79a5 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -65,6 +65,9 @@ option('lirc', option('openssl', type : 'feature', value : 'auto', description : 'Optional OpenSSL support (used for Airtunes/RAOP)') +option('samplerate', + type : 'feature', value : 'disabled', + description : 'Optional libsamplerate support (DEPRECATED)') option('soxr', type : 'feature', value : 'auto', description : 'Optional SoXR support (resampling)') diff --git a/src/pulsecore/meson.build b/src/pulsecore/meson.build index 96f8046e6..467f64e97 100644 --- a/src/pulsecore/meson.build +++ b/src/pulsecore/meson.build @@ -126,6 +126,10 @@ if dbus_dep.found() ] endif +if samplerate_dep.found() + libpulsecore_sources += ['resampler/libsamplerate.c'] +endif + if soxr_dep.found() libpulsecore_sources += ['resampler/soxr.c'] endif @@ -167,7 +171,7 @@ libpulsecore = shared_library('pulsecore-' + pa_version_major_minor, c_args : [pa_c_args, server_c_args], install : true, link_with : libpulsecore_simd_lib, - dependencies : [libm_dep, libpulsecommon_dep, libpulse_dep, ltdl_dep, shm_dep, sndfile_dep, database_dep, dbus_dep, soxr_dep, speex_dep, x11_dep], + dependencies : [libm_dep, libpulsecommon_dep, libpulse_dep, ltdl_dep, shm_dep, sndfile_dep, database_dep, dbus_dep, samplerate_dep, soxr_dep, speex_dep, x11_dep], implicit_include_directories : false) libpulsecore_dep = declare_dependency(link_with: libpulsecore)