[MPlayer-dev-eng] [PATCH] mute audio on NetBSD with sun audio output driver

Alexander Becher abecher at kawo2.rwth-aachen.de
Thu Dec 22 01:50:01 CET 2005


Hi,

for some time, muting the audio has not been working in MPlayer on my
NetBSD system. Today I got annoyed enough, digged through the code,
found the cause and fixed it.

Since revision 1.19 of the file libao2/ao_sun.c, muting is as follows:
mixer volume is not changed, only a mute flag is set, which does not
exist on NetBSD (nor on OpenBSD to my knowledge). Therefore, muting has
no effect. With the attached patch, when the volume levels are
requested to be set to zero, they are changed in addition to the mute
flag being set.

Regards
Alexander
-- 
PGP key available
Port Payé / Entgelt bezahlt / Postage Paid: http://www.hashcash.org/
-------------- next part --------------
--- libao2/ao_sun.c.orig	2005-01-06 23:56:54.000000000 +0100
+++ libao2/ao_sun.c	2005-12-22 00:57:31.000000000 +0100
@@ -430,13 +430,11 @@
 	    float volume;
 	    AUDIO_INITINFO(&info);
 	    volume = vol->right > vol->left ? vol->right : vol->left;
-	    if ( volume != 0 ) {
-		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.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);
 #if !defined (__OpenBSD__) && !defined (__NetBSD__)
 	    info.output_muted = (volume == 0);
 #endif


More information about the MPlayer-dev-eng mailing list