changeset 7379:7b3c73a0c2dd

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.
author jkeil
date Thu, 12 Sep 2002 16:59:11 +0000
parents 9fb2113b4869
children feab2ba19f8c
files libao2/ao_sun.c
diffstat 1 files changed, 8 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/libao2/ao_sun.c	Thu Sep 12 12:56:05 2002 +0000
+++ b/libao2/ao_sun.c	Thu Sep 12 16:59:11 2002 +0000
@@ -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;