meson.build: always enable Wave encoder for Snapcast

Even if the "wave_encoder" option is disabled (and no other encoder
plugins are enabled), forcefully enable the Wave encoder (if Snapcast
is enabled).

Closes https://github.com/MusicPlayerDaemon/MPD/issues/1500
This commit is contained in:
Max Kellermann 2022-04-26 20:05:20 +02:00
parent 83572701f4
commit 85f9863e0a
4 changed files with 20 additions and 5 deletions

View File

@ -3,6 +3,22 @@ encoder_features = configuration_data()
encoder_features.set('ENABLE_ENCODER', need_encoder)
if not need_encoder
if need_wave_encoder
# Special case for the Snapcast output plugin which only needs the
# PCM wave encoder encoder plugin
encoder_glue = static_library(
'encoder_glue',
'plugins/WaveEncoderPlugin.cxx',
include_directories: inc,
)
encoder_glue_dep = declare_dependency(
link_with: encoder_glue,
)
subdir_done()
endif
encoder_glue_dep = dependency('', required: false)
configure_file(output: 'Features.h', configuration: encoder_features)
subdir_done()

View File

@ -35,7 +35,7 @@ if libshine_dep.found()
endif
encoder_features.set('ENABLE_WAVE_ENCODER', get_option('wave_encoder'))
if get_option('wave_encoder')
if get_option('wave_encoder') or need_wave_encoder
encoder_plugins_sources += 'WaveEncoderPlugin.cxx'
endif

View File

@ -10,6 +10,7 @@ output_plugins_deps = [
]
need_encoder = false
need_wave_encoder = false
if alsa_dep.found()
output_plugins_sources += 'AlsaOutputPlugin.cxx'
@ -127,9 +128,7 @@ if get_option('snapcast')
output_features.set('HAVE_YAJL', yajl_dep.found())
# TODO: the Snapcast plugin needs just the "wave" encoder, but this
# enables all available encoders
need_encoder = true
need_wave_encoder = true
endif
enable_solaris_output = get_option('solaris_output')

View File

@ -572,7 +572,7 @@ executable(
# Encoder
#
if encoder_glue_dep.found()
if need_encoder
executable(
'run_encoder',
'run_encoder.cxx',