From 9cbfa66886257d0df4c677c01e37be05bbf6f266 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 20 Jan 2020 14:54:21 +0100 Subject: [PATCH] command/partition: don't create null output in new partitions No output at all is fine. If the partition needs an output, it must be moved there, but having just a null output isn't helpful. --- src/command/PartitionCommands.cxx | 2 -- src/output/MultipleOutputs.cxx | 15 --------------- src/output/MultipleOutputs.hxx | 3 --- 3 files changed, 20 deletions(-) diff --git a/src/command/PartitionCommands.cxx b/src/command/PartitionCommands.cxx index 0e6e0d324..bbb0e0143 100644 --- a/src/command/PartitionCommands.cxx +++ b/src/command/PartitionCommands.cxx @@ -105,8 +105,6 @@ handle_newpartition(Client &client, Request request, Response &response) AudioFormat::Undefined(), ReplayGainConfig()); auto &partition = instance.partitions.back(); - partition.outputs.AddNullOutput(instance.io_thread.GetEventLoop(), - ReplayGainConfig()); partition.UpdateEffectiveReplayGainMode(); instance.EmitIdle(IDLE_PARTITION); diff --git a/src/output/MultipleOutputs.cxx b/src/output/MultipleOutputs.cxx index 8aab44b6b..87d65a1ea 100644 --- a/src/output/MultipleOutputs.cxx +++ b/src/output/MultipleOutputs.cxx @@ -117,21 +117,6 @@ MultipleOutputs::Configure(EventLoop &event_loop, } } -void -MultipleOutputs::AddNullOutput(EventLoop &event_loop, - const ReplayGainConfig &replay_gain_config) -{ - const AudioOutputDefaults defaults; - - ConfigBlock block; - block.AddBlockParam("type", "null"); - - outputs.emplace_back(LoadOutputControl(event_loop, replay_gain_config, - mixer_listener, - client, block, defaults, - nullptr)); -} - AudioOutputControl * MultipleOutputs::FindByName(const char *name) noexcept { diff --git a/src/output/MultipleOutputs.hxx b/src/output/MultipleOutputs.hxx index 0a1333dcd..fc65e8460 100644 --- a/src/output/MultipleOutputs.hxx +++ b/src/output/MultipleOutputs.hxx @@ -78,9 +78,6 @@ public: const ConfigData &config, const ReplayGainConfig &replay_gain_config); - void AddNullOutput(EventLoop &event_loop, - const ReplayGainConfig &replay_gain_config); - /** * Returns the total number of audio output devices, including * those which are disabled right now.