summaryrefslogtreecommitdiff
path: root/src/output
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2017-12-27 09:17:15 +0100
committerMax Kellermann <max@musicpd.org>2017-12-27 11:39:01 +0100
commite2621d5e44be0da281edd7d6906a085360959fde (patch)
tree6c4a5fae2488b31f70b01c04809c2e1ab18b9028 /src/output
parent0e3ff12dd35bce20bc1ed1fba4a148de572e0c8c (diff)
filter/Plugin: return std::unique_ptr<PreparedFilter>
Diffstat (limited to 'src/output')
-rw-r--r--src/output/Filtered.hxx6
-rw-r--r--src/output/Finish.cxx4
-rw-r--r--src/output/Init.cxx3
-rw-r--r--src/output/Thread.cxx4
4 files changed, 7 insertions, 10 deletions
diff --git a/src/output/Filtered.hxx b/src/output/Filtered.hxx
index 34ac4de38..59ab78e3f 100644
--- a/src/output/Filtered.hxx
+++ b/src/output/Filtered.hxx
@@ -93,7 +93,7 @@ public:
* The filter object of this audio output. This is an
* instance of chain_filter_plugin.
*/
- PreparedFilter *prepared_filter = nullptr;
+ std::unique_ptr<PreparedFilter> prepared_filter;
/**
* The #VolumeFilter instance of this audio output. It is
@@ -105,14 +105,14 @@ public:
* The replay_gain_filter_plugin instance of this audio
* output.
*/
- PreparedFilter *prepared_replay_gain_filter = nullptr;
+ std::unique_ptr<PreparedFilter> prepared_replay_gain_filter;
/**
* The replay_gain_filter_plugin instance of this audio
* output, to be applied to the second chunk during
* cross-fading.
*/
- PreparedFilter *prepared_other_replay_gain_filter = nullptr;
+ std::unique_ptr<PreparedFilter> prepared_other_replay_gain_filter;
/**
* The convert_filter_plugin instance of this audio output.
diff --git a/src/output/Finish.cxx b/src/output/Finish.cxx
index 9e1c4eb46..a3714586f 100644
--- a/src/output/Finish.cxx
+++ b/src/output/Finish.cxx
@@ -27,10 +27,6 @@ FilteredAudioOutput::~FilteredAudioOutput()
{
if (mixer != nullptr)
mixer_free(mixer);
-
- delete prepared_replay_gain_filter;
- delete prepared_other_replay_gain_filter;
- delete prepared_filter;
}
void
diff --git a/src/output/Init.cxx b/src/output/Init.cxx
index 70bb960a3..9dbd14ef6 100644
--- a/src/output/Init.cxx
+++ b/src/output/Init.cxx
@@ -22,12 +22,13 @@
#include "Registry.hxx"
#include "Domain.hxx"
#include "OutputAPI.hxx"
-#include "filter/FilterConfig.hxx"
#include "AudioParser.hxx"
#include "mixer/MixerList.hxx"
#include "mixer/MixerType.hxx"
#include "mixer/MixerControl.hxx"
#include "mixer/plugins/SoftwareMixerPlugin.hxx"
+#include "filter/FilterConfig.hxx"
+#include "filter/FilterInternal.hxx"
#include "filter/plugins/AutoConvertFilterPlugin.hxx"
#include "filter/plugins/ConvertFilterPlugin.hxx"
#include "filter/plugins/ReplayGainFilterPlugin.hxx"
diff --git a/src/output/Thread.cxx b/src/output/Thread.cxx
index fe2e42512..2ff81c8e3 100644
--- a/src/output/Thread.cxx
+++ b/src/output/Thread.cxx
@@ -146,8 +146,8 @@ AudioOutputControl::InternalOpen(const AudioFormat in_audio_format,
try {
try {
f = source.Open(in_audio_format, pipe,
- output->prepared_replay_gain_filter,
- output->prepared_other_replay_gain_filter,
+ output->prepared_replay_gain_filter.get(),
+ output->prepared_other_replay_gain_filter.get(),
*output->prepared_filter);
} catch (...) {
std::throw_with_nested(FormatRuntimeError("Failed to open filter for %s",