Merge branch 'v0.23.x'

This commit is contained in:
Max Kellermann 2022-08-18 16:54:18 +02:00
commit dd2cab1488
4 changed files with 14 additions and 8 deletions

2
NEWS
View File

@ -23,6 +23,8 @@ ver 0.23.9 (not yet released)
- cdio_paranoia: add options "mode" and "skip" - cdio_paranoia: add options "mode" and "skip"
* decoder * decoder
- ffmpeg: support FFmpeg 5.1 - ffmpeg: support FFmpeg 5.1
* filter
- replay gain: fix delayed volume display with handler=mixer
* output * output
- pipewire: set app icon - pipewire: set app icon
* fix bogus volume levels with multiple partitions * fix bogus volume levels with multiple partitions

View File

@ -23,6 +23,8 @@
#include "tag/ReplayGainInfo.hxx" #include "tag/ReplayGainInfo.hxx"
#include "config/ReplayGainConfig.hxx" #include "config/ReplayGainConfig.hxx"
#include "mixer/MixerControl.hxx" #include "mixer/MixerControl.hxx"
#include "mixer/MixerInternal.hxx"
#include "mixer/Listener.hxx"
#include "pcm/AudioFormat.hxx" #include "pcm/AudioFormat.hxx"
#include "pcm/Volume.hxx" #include "pcm/Volume.hxx"
#include "util/Domain.hxx" #include "util/Domain.hxx"
@ -170,9 +172,11 @@ ReplayGainFilter::Update()
try { try {
mixer_set_volume(mixer, _volume); mixer_set_volume(mixer, _volume);
/* TODO: emit this idle event only for the /* invoke the mixer's listener manually, just
current partition */ in case the mixer implementation didn't do
idle_add(IDLE_MIXER); that already (this depends on the
implementation) */
mixer->listener.OnMixerVolumeChanged(*mixer, _volume);
} catch (...) { } catch (...) {
LogError(std::current_exception(), LogError(std::current_exception(),
"Failed to update hardware mixer"); "Failed to update hardware mixer");

View File

@ -188,8 +188,8 @@ MultipleOutputs::SetSoftwareVolume(unsigned volume) noexcept
auto *mixer = ao->GetMixer(); auto *mixer = ao->GetMixer();
if (mixer != nullptr && if (mixer != nullptr &&
(&mixer->plugin == &software_mixer_plugin || (mixer->IsPlugin(software_mixer_plugin) ||
&mixer->plugin == &null_mixer_plugin)) mixer->IsPlugin(null_mixer_plugin)))
mixer_set_volume(mixer, volume); mixer_set_volume(mixer, volume);
} }
} }

View File

@ -92,7 +92,7 @@ mixer_close(Mixer *mixer)
void void
mixer_auto_close(Mixer *mixer) mixer_auto_close(Mixer *mixer)
{ {
if (!mixer->plugin.global) if (!mixer->IsGlobal())
mixer_close(mixer); mixer_close(mixer);
} }
@ -103,7 +103,7 @@ mixer_get_volume(Mixer *mixer)
assert(mixer != nullptr); assert(mixer != nullptr);
if (mixer->plugin.global && !mixer->failure) if (mixer->IsGlobal() && !mixer->failure)
mixer_open(mixer); mixer_open(mixer);
const std::scoped_lock<Mutex> protect(mixer->mutex); const std::scoped_lock<Mutex> protect(mixer->mutex);
@ -128,7 +128,7 @@ mixer_set_volume(Mixer *mixer, unsigned volume)
assert(mixer != nullptr); assert(mixer != nullptr);
assert(volume <= 100); assert(volume <= 100);
if (mixer->plugin.global && !mixer->failure) if (mixer->IsGlobal() && !mixer->failure)
mixer_open(mixer); mixer_open(mixer);
const std::scoped_lock<Mutex> protect(mixer->mutex); const std::scoped_lock<Mutex> protect(mixer->mutex);