summaryrefslogtreecommitdiffstats
path: root/mixer.c
diff options
context:
space:
mode:
authorpontscho <pontscho@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-06-06 07:13:57 +0000
committerpontscho <pontscho@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-06-06 07:13:57 +0000
commit08b4af80fac1446b54413219173aeb2e64d8f99d (patch)
tree02d1cdc41b35f56defc6c4930b11f1acc161db47 /mixer.c
parent414248ded1fc5c3e32d98124548caaf4828b8407 (diff)
downloadmpv-08b4af80fac1446b54413219173aeb2e64d8f99d.tar.bz2
mpv-08b4af80fac1446b54413219173aeb2e64d8f99d.tar.xz
add mute support ( step 1 ) and fixed panscan bugs (1000l for me)
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@6312 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'mixer.c')
-rw-r--r--mixer.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/mixer.c b/mixer.c
index 1d723f65c6..7b647e5b71 100644
--- a/mixer.c
+++ b/mixer.c
@@ -13,6 +13,10 @@ extern ao_functions_t *audio_out;
char * mixer_device=NULL;
+int muted = 0;
+float mute_l = 0.0f;
+float mute_r = 0.0f;
+
void mixer_getvolume( float *l,float *r )
{
ao_control_vol_t vol;
@@ -33,6 +37,7 @@ void mixer_setvolume( float l,float r )
if(CONTROL_OK != audio_out->control(AOCONTROL_SET_VOLUME,(int)&vol))
return;
}
+ muted=0;
}
#define MIXER_CHANGE 3
@@ -66,7 +71,16 @@ float mixer_getbothvolume( void )
return ( mixer_l + mixer_r ) / 2;
}
-
+void mixer_mute( void )
+{
+ if ( muted ) mixer_setvolume( mute_l,mute_r );
+ else
+ {
+ mixer_getvolume( &mute_l,&mute_r );
+ mixer_setvolume( 0,0 );
+ muted=1;
+ }
+}