Commit 85f9863e authored by Max Kellermann's avatar Max Kellermann

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
parent 83572701
...@@ -3,6 +3,22 @@ encoder_features = configuration_data() ...@@ -3,6 +3,22 @@ encoder_features = configuration_data()
encoder_features.set('ENABLE_ENCODER', need_encoder) encoder_features.set('ENABLE_ENCODER', need_encoder)
if not 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) encoder_glue_dep = dependency('', required: false)
configure_file(output: 'Features.h', configuration: encoder_features) configure_file(output: 'Features.h', configuration: encoder_features)
subdir_done() subdir_done()
......
...@@ -35,7 +35,7 @@ if libshine_dep.found() ...@@ -35,7 +35,7 @@ if libshine_dep.found()
endif endif
encoder_features.set('ENABLE_WAVE_ENCODER', get_option('wave_encoder')) 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' encoder_plugins_sources += 'WaveEncoderPlugin.cxx'
endif endif
......
...@@ -10,6 +10,7 @@ output_plugins_deps = [ ...@@ -10,6 +10,7 @@ output_plugins_deps = [
] ]
need_encoder = false need_encoder = false
need_wave_encoder = false
if alsa_dep.found() if alsa_dep.found()
output_plugins_sources += 'AlsaOutputPlugin.cxx' output_plugins_sources += 'AlsaOutputPlugin.cxx'
...@@ -127,9 +128,7 @@ if get_option('snapcast') ...@@ -127,9 +128,7 @@ if get_option('snapcast')
output_features.set('HAVE_YAJL', yajl_dep.found()) output_features.set('HAVE_YAJL', yajl_dep.found())
# TODO: the Snapcast plugin needs just the "wave" encoder, but this need_wave_encoder = true
# enables all available encoders
need_encoder = true
endif endif
enable_solaris_output = get_option('solaris_output') enable_solaris_output = get_option('solaris_output')
......
...@@ -572,7 +572,7 @@ executable( ...@@ -572,7 +572,7 @@ executable(
# Encoder # Encoder
# #
if encoder_glue_dep.found() if need_encoder
executable( executable(
'run_encoder', 'run_encoder',
'run_encoder.cxx', 'run_encoder.cxx',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment