From 0e3ff12dd35bce20bc1ed1fba4a148de572e0c8c Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 27 Dec 2017 11:34:43 +0100 Subject: [PATCH] filter/volume: remove from filter_plugins[] Thsi filter doesn't make sense as manually configured plugin, because nobody ever calls volume_filter_set() on it, making it a no-op. --- src/filter/FilterRegistry.cxx | 1 - src/filter/FilterRegistry.hxx | 1 - src/filter/plugins/VolumeFilterPlugin.cxx | 13 ------------- 3 files changed, 15 deletions(-) diff --git a/src/filter/FilterRegistry.cxx b/src/filter/FilterRegistry.cxx index ffbbb9c3d..058f9068b 100644 --- a/src/filter/FilterRegistry.cxx +++ b/src/filter/FilterRegistry.cxx @@ -27,7 +27,6 @@ static const FilterPlugin *const filter_plugins[] = { &null_filter_plugin, &route_filter_plugin, &normalize_filter_plugin, - &volume_filter_plugin, nullptr, }; diff --git a/src/filter/FilterRegistry.hxx b/src/filter/FilterRegistry.hxx index dbc734683..02855cd84 100644 --- a/src/filter/FilterRegistry.hxx +++ b/src/filter/FilterRegistry.hxx @@ -33,7 +33,6 @@ struct FilterPlugin; extern const FilterPlugin null_filter_plugin; extern const FilterPlugin route_filter_plugin; extern const FilterPlugin normalize_filter_plugin; -extern const FilterPlugin volume_filter_plugin; gcc_pure const FilterPlugin * diff --git a/src/filter/plugins/VolumeFilterPlugin.cxx b/src/filter/plugins/VolumeFilterPlugin.cxx index b3fac53de..81282dcc1 100644 --- a/src/filter/plugins/VolumeFilterPlugin.cxx +++ b/src/filter/plugins/VolumeFilterPlugin.cxx @@ -19,9 +19,7 @@ #include "config.h" #include "VolumeFilterPlugin.hxx" -#include "filter/FilterPlugin.hxx" #include "filter/FilterInternal.hxx" -#include "filter/FilterRegistry.hxx" #include "pcm/Volume.hxx" #include "AudioFormat.hxx" #include "util/ConstBuffer.hxx" @@ -55,12 +53,6 @@ public: Filter *Open(AudioFormat &af) override; }; -static PreparedFilter * -volume_filter_init(gcc_unused const ConfigBlock &block) -{ - return new PreparedVolumeFilter(); -} - Filter * PreparedVolumeFilter::Open(AudioFormat &audio_format) { @@ -73,11 +65,6 @@ VolumeFilter::FilterPCM(ConstBuffer src) return pv.Apply(src); } -const FilterPlugin volume_filter_plugin = { - "volume", - volume_filter_init, -}; - PreparedFilter * volume_filter_prepare() noexcept {