From 351b39e0c5b70380074464522264e5106bf476da Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 6 Aug 2021 17:59:26 +0200 Subject: [PATCH] mixer/alsa: skip the snd_mixer_handle_events() call in alsa_mixer_elem_callback() snd_mixer_handle_events() has already been called by DispatchSockets(). This way, we can also skip the exception handler. --- src/mixer/plugins/AlsaMixerPlugin.cxx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/mixer/plugins/AlsaMixerPlugin.cxx b/src/mixer/plugins/AlsaMixerPlugin.cxx index 17f38a14b..27243cfb4 100644 --- a/src/mixer/plugins/AlsaMixerPlugin.cxx +++ b/src/mixer/plugins/AlsaMixerPlugin.cxx @@ -166,11 +166,8 @@ AlsaMixer::ElemCallback(snd_mixer_elem_t *elem, unsigned mask) noexcept snd_mixer_elem_get_callback_private(elem); if (mask & SND_CTL_EVENT_MASK_VALUE) { - try { - int volume = mixer.GetVolume(); - mixer.listener.OnMixerVolumeChanged(mixer, volume); - } catch (...) { - } + int volume = mixer.GetPercentVolume(); + mixer.listener.OnMixerVolumeChanged(mixer, volume); } return 0;