1
mirror of https://github.com/mpv-player/mpv synced 2024-12-28 06:03:45 +01:00

use snd_mixer_selem_set_playback_switch when muting ALSA, patch by Matthias Lederhofer <matled -at- gmx dot net>

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17195 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
wanderer 2005-12-15 17:50:29 +00:00
parent 2ca0ead846
commit dd75eef3f3

View File

@ -197,6 +197,17 @@ static int control(int cmd, void *arg)
}
mp_msg(MSGT_AO,MSGL_DBG2,"right=%li, pmin=%li, pmax=%li, mult=%f\n",
set_vol, pmin, pmax, f_multi);
if (snd_mixer_selem_has_playback_switch(elem)) {
int lmute = (vol->left == 0.0);
int rmute = (vol->right == 0.0);
if (snd_mixer_selem_has_playback_switch_joined(elem)) {
lmute = rmute = lmute && rmute;
} else {
snd_mixer_selem_set_playback_switch(elem, SND_MIXER_SCHN_FRONT_RIGHT, !rmute);
}
snd_mixer_selem_set_playback_switch(elem, SND_MIXER_SCHN_FRONT_LEFT, !lmute);
}
}
else {
snd_mixer_selem_get_playback_volume(elem, 0, &get_vol);