[MPlayer-cvslog] CVS: main/libao2 ao_alsa.c,1.21,1.22

The Wanderer CVS syncmail at mplayerhq.hu
Thu Dec 15 18:50:31 CET 2005


CVS change done by The Wanderer CVS

Update of /cvsroot/mplayer/main/libao2
In directory mail:/var2/tmp/cvs-serv12375/libao2

Modified Files:
	ao_alsa.c 
Log Message:
use snd_mixer_selem_set_playback_switch when muting ALSA, patch by Matthias Lederhofer <matled -at- gmx dot net>

Index: ao_alsa.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_alsa.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- ao_alsa.c	5 Dec 2005 01:31:03 -0000	1.21
+++ ao_alsa.c	15 Dec 2005 17:50:29 -0000	1.22
@@ -197,6 +197,17 @@
 	}
 	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);




More information about the MPlayer-cvslog mailing list