From 93c2e6ec320016a3b3a3764db44fc7434d37d031 Mon Sep 17 00:00:00 2001 From: Marvin Scholz Date: Thu, 5 Feb 2026 16:33:37 +0100 Subject: [PATCH] buildsystem: detect new libspatialaudio We can use the presence of the version header to detect libspatialaudio 0.4.0 or higher. (For more granular checks in the future, the defines from the version header can be checked) --- configure.ac | 9 +++++++++ modules/audio_filter/meson.build | 9 +++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 69cd6cbe29..ab432d34cf 100644 --- a/configure.ac +++ b/configure.ac @@ -2966,6 +2966,15 @@ dnl Ambisonic channel mixer and binauralizer plugin dnl PKG_ENABLE_MODULES_VLC([SPATIALAUDIO], [], [spatialaudio], [Ambisonic channel mixer and binauralizer], [auto]) +AS_IF([test -n ${SPATIALAUDIO_CFLAGS+set}], [ + VLC_SAVE_FLAGS + AX_APPEND_FLAG([$SPATIALAUDIO_CFLAGS], [CFLAGS]) + AC_CHECK_HEADER([spatialaudio/SpatialaudioVersion.h], [ + AX_APPEND_FLAG([-DHAVE_SPATIALAUDIOVERSION_H=1], [SPATIALAUDIO_CFLAGS]) + ]) + VLC_RESTORE_FLAGS +]) + dnl dnl theora decoder plugin dnl diff --git a/modules/audio_filter/meson.build b/modules/audio_filter/meson.build index d62ef929ee..521ee6c2a7 100644 --- a/modules/audio_filter/meson.build +++ b/modules/audio_filter/meson.build @@ -157,10 +157,16 @@ vlc_modules += { # Spatial audio (ambisonics/binaural) mixer spatial_dep = dependency('spatialaudio', required: get_option('spatialaudio')) if spatial_dep.found() + spatial_extra_cflags = [] + if (spatial_dep.version().version_compare('>= 0.4.0')) + spatial_extra_cflags += ['-DHAVE_SPATIALAUDIOVERSION_H=1'] + endif + vlc_modules += { 'name' : 'spatialaudio', 'sources' : files('channel_mixer/spatialaudio.cpp'), - 'dependencies' : [spatial_dep] + 'dependencies' : [spatial_dep], + 'c_args' : spatial_extra_cflags } endif @@ -242,4 +248,3 @@ if rnnoise_dep.found() 'dependencies' : [m_lib, rnnoise_dep] } endif -