output/Command: trigger IDLE_OUTPUT only for the current partition

Closes https://github.com/MusicPlayerDaemon/MPD/issues/1622
This commit is contained in:
Max Kellermann
2024-07-08 15:48:06 +02:00
parent bdc5602244
commit 553c2e9e2b
3 changed files with 23 additions and 33 deletions

View File

@@ -19,8 +19,7 @@ handle_enableoutput(Client &client, Request args, Response &r)
auto &partition = client.GetPartition();
if (!audio_output_enable_index(partition.outputs,
partition.mixer_memento,
if (!audio_output_enable_index(partition,
device)) {
r.Error(ACK_ERROR_NO_EXIST, "No such audio output");
return CommandResult::ERROR;
@@ -37,8 +36,7 @@ handle_disableoutput(Client &client, Request args, Response &r)
auto &partition = client.GetPartition();
if (!audio_output_disable_index(partition.outputs,
partition.mixer_memento,
if (!audio_output_disable_index(partition,
device)) {
r.Error(ACK_ERROR_NO_EXIST, "No such audio output");
return CommandResult::ERROR;
@@ -55,8 +53,7 @@ handle_toggleoutput(Client &client, Request args, Response &r)
auto &partition = client.GetPartition();
if (!audio_output_toggle_index(partition.outputs,
partition.mixer_memento,
if (!audio_output_toggle_index(partition,
device)) {
r.Error(ACK_ERROR_NO_EXIST, "No such audio output");
return CommandResult::ERROR;