Skip to content

Commit

Permalink
Some fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitozz committed Aug 15, 2015
1 parent f738893 commit 0b47594
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions alsawork/alsadevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,6 @@ void AlsaDevice::setMute(bool enabled)

bool AlsaDevice::getMute()
{
bool isMute = true;
if (!currentMixerName_.empty()) {
snd_mixer_t *handle = getMixerHanlde(id_);
snd_mixer_elem_t* elem = initMixerElement(handle, currentMixerName_.c_str());
Expand All @@ -378,20 +377,22 @@ bool AlsaDevice::getMute()
|| snd_mixer_selem_has_playback_switch_joined(elem)) {
int value = 0;
checkError(snd_mixer_selem_get_playback_switch(elem, channel, &value));
isMute = bool(value);
checkError(snd_mixer_close(handle));
return bool(value);
}
if (snd_mixer_selem_has_capture_switch(elem)
|| snd_mixer_selem_has_common_switch(elem)
|| snd_mixer_selem_has_capture_switch_joined(elem)
|| snd_mixer_selem_has_capture_switch_exclusive(elem)) {
int value = 0;
checkError(snd_mixer_selem_get_capture_switch(elem, channel, &value));
isMute = bool(value);
checkError(snd_mixer_close(handle));
return bool(value);
}
}
checkError(snd_mixer_close(handle));
}
return isMute;
return true;
}

std::string AlsaDevice::formatCardName(long long int id)
Expand Down

0 comments on commit 0b47594

Please sign in to comment.