File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -368,7 +368,6 @@ void AlsaDevice::setMute(bool enabled)
368368
369369bool AlsaDevice::getMute ()
370370{
371- bool isMute = true ;
372371 if (!currentMixerName_.empty ()) {
373372 snd_mixer_t *handle = getMixerHanlde (id_);
374373 snd_mixer_elem_t * elem = initMixerElement (handle, currentMixerName_.c_str ());
@@ -378,20 +377,22 @@ bool AlsaDevice::getMute()
378377 || snd_mixer_selem_has_playback_switch_joined (elem)) {
379378 int value = 0 ;
380379 checkError (snd_mixer_selem_get_playback_switch (elem, channel, &value));
381- isMute = bool (value);
380+ checkError (snd_mixer_close (handle));
381+ return bool (value);
382382 }
383383 if (snd_mixer_selem_has_capture_switch (elem)
384384 || snd_mixer_selem_has_common_switch (elem)
385385 || snd_mixer_selem_has_capture_switch_joined (elem)
386386 || snd_mixer_selem_has_capture_switch_exclusive (elem)) {
387387 int value = 0 ;
388388 checkError (snd_mixer_selem_get_capture_switch (elem, channel, &value));
389- isMute = bool (value);
389+ checkError (snd_mixer_close (handle));
390+ return bool (value);
390391 }
391392 }
392393 checkError (snd_mixer_close (handle));
393394 }
394- return isMute ;
395+ return true ;
395396}
396397
397398std::string AlsaDevice::formatCardName (long long int id)
You can’t perform that action at this time.
0 commit comments