output/Thread: move software_mixer_set_filter() call to Open()

.. and remove the obsolete method OpenFilter().
This commit is contained in:
Max Kellermann 2016-12-27 14:44:39 +01:00
parent d6d465cdf4
commit 9e33074735
2 changed files with 3 additions and 23 deletions

View File

@ -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.
*/

View File

@ -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);