[Mplayer-cvslog] CVS: main mplayer.c,1.276,1.277 mixer.c,1.8,1.9

Atmosfear atmos4 at mplayer.dev.hu
Tue Sep 11 18:26:58 CEST 2001


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

Modified Files:
	mplayer.c mixer.c 
Log Message:
Applied fix for mixercontrol w/alsa ossemu by Christian Ohm.


Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.276
retrieving revision 1.277
diff -u -r1.276 -r1.277
--- mplayer.c	6 Sep 2001 20:44:42 -0000	1.276
+++ mplayer.c	11 Sep 2001 16:26:41 -0000	1.277
@@ -1645,22 +1645,17 @@
     case '0':
     case '*':
     case '/': {
-        float mixer_l, mixer_r;
-        mixer_getvolume( &mixer_l,&mixer_r );
         if(c=='*' || c=='0'){
-            if ( ++mixer_l > 100 ) mixer_l = 100;
-            if ( ++mixer_r > 100 ) mixer_r = 100;
+               mixer_incvolume();
         } else {
-            if ( --mixer_l < 0 ) mixer_l = 0;
-            if ( --mixer_r < 0 ) mixer_r = 0;
+               mixer_decvolume();
         }
-        mixer_setvolume( mixer_l,mixer_r );
 
 #ifdef USE_OSD
         if(osd_level){
           osd_visible=sh_video->fps; // 1 sec
           vo_osd_progbar_type=OSD_VOLUME;
-          vo_osd_progbar_value=((mixer_l+mixer_r)*256.0)/200.0;
+          vo_osd_progbar_value=(mixer_getbothvolume()*256.0)/100.0;
           //printf("volume: %d\n",vo_osd_progbar_value);
         }
 #endif

Index: mixer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mixer.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- mixer.c	8 Jun 2001 23:33:55 -0000	1.8
+++ mixer.c	11 Sep 2001 16:26:41 -0000	1.9
@@ -127,14 +127,15 @@
 
 #endif
 
+#define MIXER_CHANGE 3
 
 void mixer_incvolume( void )
 {
  float mixer_l, mixer_r;
  mixer_getvolume( &mixer_l,&mixer_r );
- mixer_l++;
+ mixer_l += MIXER_CHANGE;
  if ( mixer_l > 100 ) mixer_l = 100;
- mixer_r++;
+ mixer_r += MIXER_CHANGE;
  if ( mixer_r > 100 ) mixer_r = 100;
  mixer_setvolume( mixer_l,mixer_r );
 }
@@ -143,9 +144,9 @@
 {
  float mixer_l, mixer_r;
  mixer_getvolume( &mixer_l,&mixer_r );
- mixer_l--;
+ mixer_l -= MIXER_CHANGE;
  if ( mixer_l < 0 ) mixer_l = 0;
- mixer_r--;
+ mixer_r -= MIXER_CHANGE;
  if ( mixer_r < 0 ) mixer_r = 0;
  mixer_setvolume( mixer_l,mixer_r );
 }




More information about the MPlayer-cvslog mailing list