output/Init: pass MixerType to _load_mixer()

This commit is contained in:
Max Kellermann 2019-07-08 20:23:20 +02:00
parent b94de51ac4
commit 426891ab31

View File

@ -105,14 +105,14 @@ audio_output_mixer_type(const ConfigBlock &block,
static Mixer * static Mixer *
audio_output_load_mixer(EventLoop &event_loop, FilteredAudioOutput &ao, audio_output_load_mixer(EventLoop &event_loop, FilteredAudioOutput &ao,
const ConfigBlock &block, const ConfigBlock &block,
const AudioOutputDefaults &defaults, const MixerType mixer_type,
const MixerPlugin *plugin, const MixerPlugin *plugin,
PreparedFilter &filter_chain, PreparedFilter &filter_chain,
MixerListener &listener) MixerListener &listener)
{ {
Mixer *mixer; Mixer *mixer;
switch (audio_output_mixer_type(block, defaults)) { switch (mixer_type) {
case MixerType::NONE: case MixerType::NONE:
return nullptr; return nullptr;
@ -205,6 +205,8 @@ FilteredAudioOutput::Setup(EventLoop &event_loop,
!config_audio_format.IsFullyDefined()) !config_audio_format.IsFullyDefined())
throw std::runtime_error("Need full audio format specification"); throw std::runtime_error("Need full audio format specification");
const auto mixer_type = audio_output_mixer_type(block, defaults);
/* create the replay_gain filter */ /* create the replay_gain filter */
const char *replay_gain_handler = const char *replay_gain_handler =
@ -224,7 +226,7 @@ FilteredAudioOutput::Setup(EventLoop &event_loop,
try { try {
mixer = audio_output_load_mixer(event_loop, *this, block, mixer = audio_output_load_mixer(event_loop, *this, block,
defaults, mixer_type,
mixer_plugin, mixer_plugin,
*prepared_filter, *prepared_filter,
mixer_listener); mixer_listener);