[Mplayer-cvslog] CVS: main/libao2 ao_sun.c,1.18,1.19

Jürgen Keil jkeil at mplayerhq.hu
Thu Sep 12 18:59:27 CEST 2002


Update of /cvsroot/mplayer/main/libao2
In directory mail:/var/tmp.root/cvs-serv5169

Modified Files:
	ao_sun.c 
Log Message:
Reconstruct the muting state for the playback from a l/r volume of 0.0.
This way the sound card is really silent, when the mute state is toggled in
gmplayer.


Index: ao_sun.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_sun.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- ao_sun.c	12 Sep 2002 12:56:05 -0000	1.18
+++ ao_sun.c	12 Sep 2002 16:59:11 -0000	1.19
@@ -279,11 +279,14 @@
 	    float volume;
 	    AUDIO_INITINFO(&info);
 	    volume = vol->right > vol->left ? vol->right : vol->left;
-	    info.play.gain = volume * AUDIO_MAX_GAIN / 100;
-	    if ( vol->right == vol->left )
-		info.play.balance = AUDIO_MID_BALANCE;
-	    else
-		info.play.balance = (vol->right - vol->left + volume) * AUDIO_RIGHT_BALANCE / (2*volume);
+	    info.output_muted = (volume == 0);
+	    if ( !info.output_muted ) {
+		info.play.gain = volume * AUDIO_MAX_GAIN / 100;
+		if ( vol->right == vol->left )
+		    info.play.balance = AUDIO_MID_BALANCE;
+		else
+		    info.play.balance = (vol->right - vol->left + volume) * AUDIO_RIGHT_BALANCE / (2*volume);
+	    }
 	    ioctl( fd,AUDIO_SETINFO,&info );
 	    close( fd );
 	    return CONTROL_OK;




More information about the MPlayer-cvslog mailing list