summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2018-07-17 23:04:26 +0200
committerMax Kellermann <max@musicpd.org>2018-07-17 23:04:26 +0200
commit4d804199827484ce9f408559dd2743e439c24f90 (patch)
tree78e2214b1f05b8874ea95fe7e930c70412a81ec9 /src
parent3983caa2c853fb8303a438eeb1ae0145ba10b1ca (diff)
pcm/ConfiguredResampler: use struct ConfigData
Diffstat (limited to 'src')
-rw-r--r--src/Main.cxx2
-rw-r--r--src/pcm/ConfiguredResampler.cxx12
-rw-r--r--src/pcm/ConfiguredResampler.hxx3
-rw-r--r--src/pcm/PcmConvert.cxx4
-rw-r--r--src/pcm/PcmConvert.hxx3
5 files changed, 13 insertions, 11 deletions
diff --git a/src/Main.cxx b/src/Main.cxx
index 818b1bddf..b40f870b0 100644
--- a/src/Main.cxx
+++ b/src/Main.cxx
@@ -557,7 +557,7 @@ try {
archive_plugin_init_all();
#endif
- pcm_convert_global_init();
+ pcm_convert_global_init(raw_config);
decoder_plugin_init_all(raw_config);
diff --git a/src/pcm/ConfiguredResampler.cxx b/src/pcm/ConfiguredResampler.cxx
index 509d2cb8a..2727f7188 100644
--- a/src/pcm/ConfiguredResampler.cxx
+++ b/src/pcm/ConfiguredResampler.cxx
@@ -20,7 +20,7 @@
#include "config.h"
#include "ConfiguredResampler.hxx"
#include "FallbackResampler.hxx"
-#include "config/Global.hxx"
+#include "config/Data.hxx"
#include "config/Option.hxx"
#include "config/Domain.hxx"
#include "config/Block.hxx"
@@ -113,11 +113,11 @@ MigrateResamplerConfig(const ConfigParam *param, ConfigBlock &buffer) noexcept
}
static const ConfigBlock *
-GetResamplerConfig(ConfigBlock &buffer)
+GetResamplerConfig(const ConfigData &config, ConfigBlock &buffer)
{
const auto *old_param =
- config_get_param(ConfigOption::SAMPLERATE_CONVERTER);
- const auto *block = config_get_block(ConfigBlockOption::RESAMPLER);
+ config.GetParam(ConfigOption::SAMPLERATE_CONVERTER);
+ const auto *block = config.GetBlock(ConfigBlockOption::RESAMPLER);
if (block == nullptr)
return MigrateResamplerConfig(old_param, buffer);
@@ -130,10 +130,10 @@ GetResamplerConfig(ConfigBlock &buffer)
}
void
-pcm_resampler_global_init()
+pcm_resampler_global_init(const ConfigData &config)
{
ConfigBlock buffer;
- const auto *block = GetResamplerConfig(buffer);
+ const auto *block = GetResamplerConfig(config, buffer);
const char *plugin_name = block->GetBlockValue("plugin");
if (plugin_name == nullptr)
diff --git a/src/pcm/ConfiguredResampler.hxx b/src/pcm/ConfiguredResampler.hxx
index 98d8252fe..036928b93 100644
--- a/src/pcm/ConfiguredResampler.hxx
+++ b/src/pcm/ConfiguredResampler.hxx
@@ -22,10 +22,11 @@
#include "check.h"
+struct ConfigData;
class PcmResampler;
void
-pcm_resampler_global_init();
+pcm_resampler_global_init(const ConfigData &config);
/**
* Create a #PcmResampler instance from the implementation class
diff --git a/src/pcm/PcmConvert.cxx b/src/pcm/PcmConvert.cxx
index 548c5a9d1..8e477ef8c 100644
--- a/src/pcm/PcmConvert.cxx
+++ b/src/pcm/PcmConvert.cxx
@@ -25,9 +25,9 @@
#include <assert.h>
void
-pcm_convert_global_init()
+pcm_convert_global_init(const ConfigData &config)
{
- pcm_resampler_global_init();
+ pcm_resampler_global_init(config);
}
PcmConvert::PcmConvert() noexcept
diff --git a/src/pcm/PcmConvert.hxx b/src/pcm/PcmConvert.hxx
index 60a85b1d8..26d112103 100644
--- a/src/pcm/PcmConvert.hxx
+++ b/src/pcm/PcmConvert.hxx
@@ -31,6 +31,7 @@
#endif
template<typename T> struct ConstBuffer;
+struct ConfigData;
/**
* This object is statically allocated (within another struct), and
@@ -90,6 +91,6 @@ public:
};
void
-pcm_convert_global_init();
+pcm_convert_global_init(const ConfigData &config);
#endif