changeset 1881:d75b24bda7ce

Applied fix for mixercontrol w/alsa ossemu by Christian Ohm.
author atmos4
date Tue, 11 Sep 2001 16:26:41 +0000
parents 475ca4b64006
children 7df03a6d92e0
files mixer.c mplayer.c
diffstat 2 files changed, 8 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/mixer.c	Mon Sep 10 21:27:09 2001 +0000
+++ b/mixer.c	Tue Sep 11 16:26:41 2001 +0000
@@ -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 );
 }
--- a/mplayer.c	Mon Sep 10 21:27:09 2001 +0000
+++ b/mplayer.c	Tue Sep 11 16:26:41 2001 +0000
@@ -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