mirror of
https://github.com/mpv-player/mpv
synced 2025-01-01 04:36:24 +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:
parent
2ca0ead846
commit
dd75eef3f3
@ -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",
|
mp_msg(MSGT_AO,MSGL_DBG2,"right=%li, pmin=%li, pmax=%li, mult=%f\n",
|
||||||
set_vol, pmin, pmax, f_multi);
|
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 {
|
else {
|
||||||
snd_mixer_selem_get_playback_volume(elem, 0, &get_vol);
|
snd_mixer_selem_get_playback_volume(elem, 0, &get_vol);
|
||||||
|
Loading…
Reference in New Issue
Block a user