summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2019-03-17 23:36:52 +0100
committerMax Kellermann <max@musicpd.org>2019-03-17 23:36:52 +0100
commitc18cd941aaa4c16ac713bc4f1e16ada5281d689e (patch)
treed1dbc213c5aeca1207924ab983c6b377bf01d224 /src/lib
parent6d12c2265372b621d8400e723238631ca9d2ebcf (diff)
lib/xiph: disable Tremor detection if libvorbis was found
And disable libvorbis detection if Tremor was explicitly enabled. This fixes a crash bug caused by libvorbis/Tremor ABI conflict caused by commit 4f7d52dbf2eaee15a517363c846650d76f45739f
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/xiph/meson.build17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/lib/xiph/meson.build b/src/lib/xiph/meson.build
index 432958fee..4f3f46e64 100644
--- a/src/lib/xiph/meson.build
+++ b/src/lib/xiph/meson.build
@@ -1,7 +1,20 @@
libflac_dep = dependency('flac', version: '>= 1.2', required: get_option('flac'))
libopus_dep = dependency('opus', required: get_option('opus'))
-libvorbis_dep = dependency('vorbis', required: get_option('vorbis'))
-libvorbisidec_dep = dependency('vorbisidec', required: get_option('tremor'))
+
+if get_option('tremor').enabled()
+ # no libvorbis if Tremor was explicitly enabled
+ libvorbis_dep = dependency('', required: false)
+else
+ libvorbis_dep = dependency('vorbis', required: get_option('vorbis'))
+endif
+
+if libvorbis_dep.found()
+ # no Tremor if libvorbis is used
+ libvorbisidec_dep = dependency('', required: false)
+else
+ # attempt to auto-detect Tremor only if libvorbis was disabled or not found
+ libvorbisidec_dep = dependency('vorbisidec', required: get_option('tremor'))
+endif
if get_option('vorbis').enabled() and get_option('tremor').enabled()
error('Cannot build both, the Vorbis decoder AND the Tremor (Vorbis fixed-point) decoder')