From 9e330747352ba2b248fc66920108ec624a334534 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 27 Dec 2016 14:44:39 +0100 Subject: [PATCH] output/Thread: move software_mixer_set_filter() call to Open() .. and remove the obsolete method OpenFilter(). --- src/output/Internal.hxx | 7 ------- src/output/OutputThread.cxx | 19 +++---------------- 2 files changed, 3 insertions(+), 23 deletions(-) diff --git a/src/output/Internal.hxx b/src/output/Internal.hxx index 69972524b..f2fd8184f 100644 --- a/src/output/Internal.hxx +++ b/src/output/Internal.hxx @@ -434,13 +434,6 @@ private: */ void CloseOutput(bool drain); - /** - * Throws std::runtime_error on error. - * - * Mutex must not be locked. - */ - AudioFormat OpenFilter(AudioFormat &format); - /** * Mutex must not be locked. */ diff --git a/src/output/OutputThread.cxx b/src/output/OutputThread.cxx index 6deadc981..53d4ccab4 100644 --- a/src/output/OutputThread.cxx +++ b/src/output/OutputThread.cxx @@ -89,22 +89,6 @@ AudioOutput::Disable() } } -inline AudioFormat -AudioOutput::OpenFilter(AudioFormat &format) -{ - assert(format.IsValid()); - - const auto result = source.Open(format, *request.pipe, - prepared_replay_gain_filter, - prepared_other_replay_gain_filter, - prepared_filter); - - if (mixer != nullptr && mixer->IsPlugin(software_mixer_plugin)) - software_mixer_set_filter(*mixer, volume_filter.Get()); - - return result; -} - void AudioOutput::CloseFilter() { @@ -136,6 +120,9 @@ AudioOutput::Open() prepared_other_replay_gain_filter, prepared_filter) .WithMask(config_audio_format); + + if (mixer != nullptr && mixer->IsPlugin(software_mixer_plugin)) + software_mixer_set_filter(*mixer, volume_filter.Get()); } catch (const std::runtime_error &e) { FormatError(e, "Failed to open filter for \"%s\" [%s]", name, plugin.name);