Commit 4f7f577a authored by Max Kellermann's avatar Max Kellermann

output/Internal: add OpenSoftwareMixer()

Moved code from AudioOutputControl::InternalOpen2().
parent 612def5c
......@@ -99,6 +99,13 @@ AudioOutput::CloseOutput(bool drain) noexcept
}
void
AudioOutput::OpenSoftwareMixer() noexcept
{
if (mixer != nullptr && mixer->IsPlugin(software_mixer_plugin))
software_mixer_set_filter(*mixer, volume_filter.Get());
}
void
AudioOutput::CloseSoftwareMixer() noexcept
{
if (mixer != nullptr && mixer->IsPlugin(software_mixer_plugin))
......
......@@ -163,6 +163,11 @@ public:
/**
* Mutex must not be locked.
*/
void OpenSoftwareMixer() noexcept;
/**
* Mutex must not be locked.
*/
void CloseSoftwareMixer() noexcept;
void BeginPause() noexcept;
......
......@@ -26,7 +26,6 @@
#include "notify.hxx"
#include "filter/plugins/ConvertFilterPlugin.hxx"
#include "mixer/MixerInternal.hxx"
#include "mixer/plugins/SoftwareMixerPlugin.hxx"
#include "thread/Util.hxx"
#include "thread/Slack.hxx"
#include "thread/Name.hxx"
......@@ -53,10 +52,7 @@ AudioOutputControl::InternalOpen2(const AudioFormat in_audio_format)
{
assert(in_audio_format.IsValid());
if (output->mixer != nullptr &&
output->mixer->IsPlugin(software_mixer_plugin))
software_mixer_set_filter(*output->mixer,
output->volume_filter.Get());
output->OpenSoftwareMixer();
const auto cf = in_audio_format.WithMask(output->config_audio_format);
......
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