[Mplayer-cvslog] CVS: main mixer.c,1.11,1.12 mixer.h,1.3,1.4 mplayer.c,1.514,1.515

Zoltan Ponekker pontscho at mplayerhq.hu
Thu Jun 6 09:14:26 CEST 2002


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

Modified Files:
	mixer.c mixer.h mplayer.c 
Log Message:
add mute support ( step 1 ) and fixed panscan bugs (1000l for me)

Index: mixer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mixer.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- mixer.c	21 Feb 2002 16:02:26 -0000	1.11
+++ mixer.c	6 Jun 2002 07:13:42 -0000	1.12
@@ -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;
+   }
+}
 
 
 

Index: mixer.h
===================================================================
RCS file: /cvsroot/mplayer/main/mixer.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- mixer.h	21 Feb 2002 16:02:26 -0000	1.3
+++ mixer.h	6 Jun 2002 07:13:42 -0000	1.4
@@ -3,12 +3,14 @@
 #define __MPLAYER_MIXER
 
 extern char * mixer_device;
+extern int    muted;
 
 extern void mixer_getvolume( float *l,float *r );
 extern void mixer_setvolume( float l,float r );
 extern void mixer_incvolume( void );
 extern void mixer_decvolume( void );
 extern float mixer_getbothvolume( void );
+void mixer_mute( void );
 
 //extern void mixer_setbothvolume( int v );
 #define mixer_setbothvolume( v ) mixer_setvolume( v,v )

Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.514
retrieving revision 1.515
diff -u -r1.514 -r1.515
--- mplayer.c	5 Jun 2002 19:35:44 -0000	1.514
+++ mplayer.c	6 Jun 2002 07:13:42 -0000	1.515
@@ -2404,6 +2404,9 @@
       }
 #endif
     } break;
+    case MP_CMD_MUTE: {
+     mixer_mute();
+    }
     case MP_CMD_MIXER_USEMASTER :  {
     } break;
     case MP_CMD_CONTRAST :  {
@@ -2545,6 +2548,7 @@
 	if(video_out && vo_config_count) video_out->control(VOCTRL_FULLSCREEN, 0);
     } break;
     case MP_CMD_PANSCAN : {
+      if ( !video_out ) break;
       if ( video_out->control( VOCTRL_GET_PANSCAN,NULL ) == VO_TRUE )
        {
         int abs= cmd->args[1].v.i;




More information about the MPlayer-cvslog mailing list