Commit 3b867462 authored by Max Kellermann's avatar Max Kellermann

filter/ReplayGain: remove FilterPlugin instance, add explicit constructor

parent b8aa9348
......@@ -28,7 +28,6 @@ static const FilterPlugin *const filter_plugins[] = {
&route_filter_plugin,
&normalize_filter_plugin,
&volume_filter_plugin,
&replay_gain_filter_plugin,
nullptr,
};
......
......@@ -36,7 +36,6 @@ extern const FilterPlugin convert_filter_plugin;
extern const FilterPlugin route_filter_plugin;
extern const FilterPlugin normalize_filter_plugin;
extern const FilterPlugin volume_filter_plugin;
extern const FilterPlugin replay_gain_filter_plugin;
gcc_pure
const FilterPlugin *
......
......@@ -19,9 +19,7 @@
#include "config.h"
#include "ReplayGainFilterPlugin.hxx"
#include "filter/FilterPlugin.hxx"
#include "filter/FilterInternal.hxx"
#include "filter/FilterRegistry.hxx"
#include "AudioFormat.hxx"
#include "ReplayGainInfo.hxx"
#include "ReplayGainGlobal.hxx"
......@@ -163,8 +161,8 @@ ReplayGainFilter::Update()
pv.SetVolume(volume);
}
static PreparedFilter *
replay_gain_filter_init(gcc_unused const ConfigBlock &block)
PreparedFilter *
NewReplayGainFilter()
{
return new PreparedReplayGainFilter();
}
......@@ -183,11 +181,6 @@ ReplayGainFilter::FilterPCM(ConstBuffer<void> src)
: pv.Apply(src);
}
const FilterPlugin replay_gain_filter_plugin = {
"replay_gain",
replay_gain_filter_init,
};
void
replay_gain_filter_set_mixer(PreparedFilter &_filter, Mixer *mixer,
unsigned base)
......
......@@ -27,6 +27,9 @@ class PreparedFilter;
class Mixer;
struct ReplayGainInfo;
PreparedFilter *
NewReplayGainFilter();
/**
* Enables or disables the hardware mixer for applying replay gain.
*
......
......@@ -216,14 +216,12 @@ audio_output_setup(EventLoop &event_loop, AudioOutput &ao,
block.GetBlockValue("replay_gain_handler", "software");
if (strcmp(replay_gain_handler, "none") != 0) {
ao.prepared_replay_gain_filter = filter_new(&replay_gain_filter_plugin,
block);
ao.prepared_replay_gain_filter = NewReplayGainFilter();
assert(ao.prepared_replay_gain_filter != nullptr);
ao.replay_gain_serial = 0;
ao.prepared_other_replay_gain_filter = filter_new(&replay_gain_filter_plugin,
block);
ao.prepared_other_replay_gain_filter = NewReplayGainFilter();
assert(ao.prepared_other_replay_gain_filter != nullptr);
ao.other_replay_gain_serial = 0;
......
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