decoder/openmpt: check libopenmpt version at compile time, not at configure time
This commit is contained in:
src/decoder/plugins
@ -2,7 +2,6 @@
|
|||||||
// Copyright The Music Player Daemon Project
|
// Copyright The Music Player Daemon Project
|
||||||
|
|
||||||
#include "OpenmptDecoderPlugin.hxx"
|
#include "OpenmptDecoderPlugin.hxx"
|
||||||
#include "decoder/Features.h"
|
|
||||||
#include "ModCommon.hxx"
|
#include "ModCommon.hxx"
|
||||||
#include "../DecoderAPI.hxx"
|
#include "../DecoderAPI.hxx"
|
||||||
#include "input/InputStream.hxx"
|
#include "input/InputStream.hxx"
|
||||||
@ -28,7 +27,7 @@ static int openmpt_volume_ramping;
|
|||||||
static bool openmpt_sync_samples;
|
static bool openmpt_sync_samples;
|
||||||
static std::string_view openmpt_at_end;
|
static std::string_view openmpt_at_end;
|
||||||
static bool openmpt_emulate_amiga;
|
static bool openmpt_emulate_amiga;
|
||||||
#ifdef HAVE_LIBOPENMPT_VERSION_0_5
|
#if OPENMPT_API_VERSION_AT_LEAST(0,5,0)
|
||||||
static std::string_view openmpt_emulate_amiga_type;
|
static std::string_view openmpt_emulate_amiga_type;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -43,7 +42,7 @@ openmpt_decoder_init(const ConfigBlock &block)
|
|||||||
openmpt_sync_samples = block.GetBlockValue("sync_samples", true);
|
openmpt_sync_samples = block.GetBlockValue("sync_samples", true);
|
||||||
openmpt_at_end = block.GetBlockValue("at_end", "fadeout");
|
openmpt_at_end = block.GetBlockValue("at_end", "fadeout");
|
||||||
openmpt_emulate_amiga = block.GetBlockValue("emulate_amiga", true);
|
openmpt_emulate_amiga = block.GetBlockValue("emulate_amiga", true);
|
||||||
#ifdef HAVE_LIBOPENMPT_VERSION_0_5
|
#if OPENMPT_API_VERSION_AT_LEAST(0,5,0)
|
||||||
openmpt_emulate_amiga_type = block.GetBlockValue("emulate_amiga_type", "auto");
|
openmpt_emulate_amiga_type = block.GetBlockValue("emulate_amiga_type", "auto");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -74,7 +73,7 @@ mod_decode(DecoderClient &client, InputStream &is)
|
|||||||
mod.set_render_param(mod.RENDER_INTERPOLATIONFILTER_LENGTH, 0);
|
mod.set_render_param(mod.RENDER_INTERPOLATIONFILTER_LENGTH, 0);
|
||||||
}
|
}
|
||||||
mod.set_render_param(mod.RENDER_VOLUMERAMPING_STRENGTH, openmpt_volume_ramping);
|
mod.set_render_param(mod.RENDER_VOLUMERAMPING_STRENGTH, openmpt_volume_ramping);
|
||||||
#ifdef HAVE_LIBOPENMPT_VERSION_0_5
|
#if OPENMPT_API_VERSION_AT_LEAST(0,5,0)
|
||||||
mod.ctl_set_boolean("seek.sync_samples", openmpt_sync_samples);
|
mod.ctl_set_boolean("seek.sync_samples", openmpt_sync_samples);
|
||||||
mod.ctl_set_boolean("render.resampler.emulate_amiga", openmpt_emulate_amiga);
|
mod.ctl_set_boolean("render.resampler.emulate_amiga", openmpt_emulate_amiga);
|
||||||
mod.ctl_set_text("render.resampler.emulate_amiga_type", openmpt_emulate_amiga_type);
|
mod.ctl_set_text("render.resampler.emulate_amiga_type", openmpt_emulate_amiga_type);
|
||||||
|
@ -109,7 +109,6 @@ endif
|
|||||||
|
|
||||||
libopenmpt_dep = dependency('libopenmpt', required: get_option('openmpt'))
|
libopenmpt_dep = dependency('libopenmpt', required: get_option('openmpt'))
|
||||||
decoder_features.set('ENABLE_OPENMPT', libopenmpt_dep.found())
|
decoder_features.set('ENABLE_OPENMPT', libopenmpt_dep.found())
|
||||||
decoder_features.set('HAVE_LIBOPENMPT_VERSION_0_5', libopenmpt_dep.version().version_compare('>= 0.5'))
|
|
||||||
if libopenmpt_dep.found()
|
if libopenmpt_dep.found()
|
||||||
decoder_plugins_sources += [
|
decoder_plugins_sources += [
|
||||||
'OpenmptDecoderPlugin.cxx',
|
'OpenmptDecoderPlugin.cxx',
|
||||||
|
Reference in New Issue
Block a user