pcm/ConfiguredResampler: use struct ConfigData
This commit is contained in:
parent
3983caa2c8
commit
4d80419982
@ -557,7 +557,7 @@ try {
|
|||||||
archive_plugin_init_all();
|
archive_plugin_init_all();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
pcm_convert_global_init();
|
pcm_convert_global_init(raw_config);
|
||||||
|
|
||||||
decoder_plugin_init_all(raw_config);
|
decoder_plugin_init_all(raw_config);
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "ConfiguredResampler.hxx"
|
#include "ConfiguredResampler.hxx"
|
||||||
#include "FallbackResampler.hxx"
|
#include "FallbackResampler.hxx"
|
||||||
#include "config/Global.hxx"
|
#include "config/Data.hxx"
|
||||||
#include "config/Option.hxx"
|
#include "config/Option.hxx"
|
||||||
#include "config/Domain.hxx"
|
#include "config/Domain.hxx"
|
||||||
#include "config/Block.hxx"
|
#include "config/Block.hxx"
|
||||||
@ -113,11 +113,11 @@ MigrateResamplerConfig(const ConfigParam *param, ConfigBlock &buffer) noexcept
|
|||||||
}
|
}
|
||||||
|
|
||||||
static const ConfigBlock *
|
static const ConfigBlock *
|
||||||
GetResamplerConfig(ConfigBlock &buffer)
|
GetResamplerConfig(const ConfigData &config, ConfigBlock &buffer)
|
||||||
{
|
{
|
||||||
const auto *old_param =
|
const auto *old_param =
|
||||||
config_get_param(ConfigOption::SAMPLERATE_CONVERTER);
|
config.GetParam(ConfigOption::SAMPLERATE_CONVERTER);
|
||||||
const auto *block = config_get_block(ConfigBlockOption::RESAMPLER);
|
const auto *block = config.GetBlock(ConfigBlockOption::RESAMPLER);
|
||||||
if (block == nullptr)
|
if (block == nullptr)
|
||||||
return MigrateResamplerConfig(old_param, buffer);
|
return MigrateResamplerConfig(old_param, buffer);
|
||||||
|
|
||||||
@ -130,10 +130,10 @@ GetResamplerConfig(ConfigBlock &buffer)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
pcm_resampler_global_init()
|
pcm_resampler_global_init(const ConfigData &config)
|
||||||
{
|
{
|
||||||
ConfigBlock buffer;
|
ConfigBlock buffer;
|
||||||
const auto *block = GetResamplerConfig(buffer);
|
const auto *block = GetResamplerConfig(config, buffer);
|
||||||
|
|
||||||
const char *plugin_name = block->GetBlockValue("plugin");
|
const char *plugin_name = block->GetBlockValue("plugin");
|
||||||
if (plugin_name == nullptr)
|
if (plugin_name == nullptr)
|
||||||
|
@ -22,10 +22,11 @@
|
|||||||
|
|
||||||
#include "check.h"
|
#include "check.h"
|
||||||
|
|
||||||
|
struct ConfigData;
|
||||||
class PcmResampler;
|
class PcmResampler;
|
||||||
|
|
||||||
void
|
void
|
||||||
pcm_resampler_global_init();
|
pcm_resampler_global_init(const ConfigData &config);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a #PcmResampler instance from the implementation class
|
* Create a #PcmResampler instance from the implementation class
|
||||||
|
@ -25,9 +25,9 @@
|
|||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
void
|
void
|
||||||
pcm_convert_global_init()
|
pcm_convert_global_init(const ConfigData &config)
|
||||||
{
|
{
|
||||||
pcm_resampler_global_init();
|
pcm_resampler_global_init(config);
|
||||||
}
|
}
|
||||||
|
|
||||||
PcmConvert::PcmConvert() noexcept
|
PcmConvert::PcmConvert() noexcept
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
template<typename T> struct ConstBuffer;
|
template<typename T> struct ConstBuffer;
|
||||||
|
struct ConfigData;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This object is statically allocated (within another struct), and
|
* This object is statically allocated (within another struct), and
|
||||||
@ -90,6 +91,6 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
void
|
void
|
||||||
pcm_convert_global_init();
|
pcm_convert_global_init(const ConfigData &config);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user