output/Internal: add OpenSoftwareMixer()
Moved code from AudioOutputControl::InternalOpen2().
This commit is contained in:
@@ -98,6 +98,13 @@ AudioOutput::CloseOutput(bool drain) noexcept
|
|||||||
ao_plugin_close(*this);
|
ao_plugin_close(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
AudioOutput::OpenSoftwareMixer() noexcept
|
||||||
|
{
|
||||||
|
if (mixer != nullptr && mixer->IsPlugin(software_mixer_plugin))
|
||||||
|
software_mixer_set_filter(*mixer, volume_filter.Get());
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
AudioOutput::CloseSoftwareMixer() noexcept
|
AudioOutput::CloseSoftwareMixer() noexcept
|
||||||
{
|
{
|
||||||
|
@@ -160,6 +160,11 @@ public:
|
|||||||
*/
|
*/
|
||||||
void CloseOutput(bool drain) noexcept;
|
void CloseOutput(bool drain) noexcept;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Mutex must not be locked.
|
||||||
|
*/
|
||||||
|
void OpenSoftwareMixer() noexcept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mutex must not be locked.
|
* Mutex must not be locked.
|
||||||
*/
|
*/
|
||||||
|
@@ -26,7 +26,6 @@
|
|||||||
#include "notify.hxx"
|
#include "notify.hxx"
|
||||||
#include "filter/plugins/ConvertFilterPlugin.hxx"
|
#include "filter/plugins/ConvertFilterPlugin.hxx"
|
||||||
#include "mixer/MixerInternal.hxx"
|
#include "mixer/MixerInternal.hxx"
|
||||||
#include "mixer/plugins/SoftwareMixerPlugin.hxx"
|
|
||||||
#include "thread/Util.hxx"
|
#include "thread/Util.hxx"
|
||||||
#include "thread/Slack.hxx"
|
#include "thread/Slack.hxx"
|
||||||
#include "thread/Name.hxx"
|
#include "thread/Name.hxx"
|
||||||
@@ -53,10 +52,7 @@ AudioOutputControl::InternalOpen2(const AudioFormat in_audio_format)
|
|||||||
{
|
{
|
||||||
assert(in_audio_format.IsValid());
|
assert(in_audio_format.IsValid());
|
||||||
|
|
||||||
if (output->mixer != nullptr &&
|
output->OpenSoftwareMixer();
|
||||||
output->mixer->IsPlugin(software_mixer_plugin))
|
|
||||||
software_mixer_set_filter(*output->mixer,
|
|
||||||
output->volume_filter.Get());
|
|
||||||
|
|
||||||
const auto cf = in_audio_format.WithMask(output->config_audio_format);
|
const auto cf = in_audio_format.WithMask(output->config_audio_format);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user