Commit 47680f93 authored by Max Kellermann's avatar Max Kellermann

mixer/All: auto-open "global" mixers

If a mixer is "global", it is available even if the output isn't open. However, since the check was changed from IsEnabled() to IsReallyEnabled(), enabled outputs have not yet been used have not been "really" enabled yet, preventing using the mixer. Fixes a regression by commit 35dbc1a9 (part of https://github.com/MusicPlayerDaemon/MPD/pull/1480). Closes https://github.com/MusicPlayerDaemon/MPD/issues/1563
parent 2d718110
......@@ -5,6 +5,7 @@ ver 0.23.8 (not yet released)
- pipewire: fix crash with PipeWire 0.3.53
* mixer
- better error messages
- alsa: fix setting volume before playback starts
* support libfmt 9
ver 0.23.7 (2022/05/09)
......
......@@ -91,7 +91,10 @@ output_mixer_set_volume(AudioOutputControl &ao, unsigned volume)
/* software mixers are always updated, even if they are
disabled */
if (!ao.IsReallyEnabled() && !mixer->IsPlugin(software_mixer_plugin))
if (!mixer->IsPlugin(software_mixer_plugin) &&
/* "global" mixers can be used even if the output hasn't
been used yet */
!(mixer->IsGlobal() ? ao.IsEnabled() : ao.IsReallyEnabled()))
return SetVolumeResult::DISABLED;
try {
......
......@@ -63,6 +63,10 @@ public:
return &plugin == &other;
}
bool IsGlobal() const noexcept {
return plugin.global;
}
/**
* Open mixer device
*
......
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