Mercurial > mplayer.hg
diff mixer.c @ 6311:da2dda48b7ec
add mute support ( step 1 ) and fixed panscan bugs (1000l for me)
author | pontscho |
---|---|
date | Thu, 06 Jun 2002 07:13:57 +0000 |
parents | d678ce495a75 |
children | 12b1790038b0 |
line wrap: on
line diff
--- a/mixer.c Thu Jun 06 01:45:39 2002 +0000 +++ b/mixer.c Thu Jun 06 07:13:57 2002 +0000 @@ -13,6 +13,10 @@ 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 @@ if(CONTROL_OK != audio_out->control(AOCONTROL_SET_VOLUME,(int)&vol)) return; } + muted=0; } #define MIXER_CHANGE 3 @@ -66,7 +71,16 @@ 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; + } +} -