changeset 8868:398e3fb7c103

10l bug for float conversion control + feature fix in volume control
author anders
date Fri, 10 Jan 2003 01:45:34 +0000
parents 558f0b1f45ee
children 9df3c03b2ffe
files cfg-mplayer.h libaf/af.h libaf/af_resample.c libaf/af_volume.c
diffstat 4 files changed, 13 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/cfg-mplayer.h	Fri Jan 10 01:01:38 2003 +0000
+++ b/cfg-mplayer.h	Fri Jan 10 01:45:34 2003 +0000
@@ -127,7 +127,7 @@
 extern af_cfg_t af_cfg; // Audio filter configuration, defined in libmpcodecs/dec_audio.c
 struct config audio_filter_conf[]={       
 	{"list", &af_cfg.list, CONF_TYPE_STRING_LIST, 0, 0, 0, NULL},
-        {"force", &af_cfg.force, CONF_TYPE_INT, CONF_RANGE, 0, 3, NULL},
+        {"force", &af_cfg.force, CONF_TYPE_INT, CONF_RANGE, 0, 7, NULL},
 	{NULL, NULL, 0, 0, 0, 0, NULL}
 };
 
--- a/libaf/af.h	Fri Jan 10 01:01:38 2003 +0000
+++ b/libaf/af.h	Fri Jan 10 01:45:34 2003 +0000
@@ -70,8 +70,8 @@
 #define AF_INIT_TYPE_MASK 	0x00000003
 
 #define AF_INIT_INT		0x00000000
-#define AF_INIT_FLOAT		0x00000010
-#define AF_INIT_FORMAT_MASK	0x00000010
+#define AF_INIT_FLOAT		0x00000004
+#define AF_INIT_FORMAT_MASK	0x00000004
 
 // Default init type 
 #ifndef AF_INIT_TYPE
--- a/libaf/af_resample.c	Fri Jan 10 01:01:38 2003 +0000
+++ b/libaf/af_resample.c	Fri Jan 10 01:45:34 2003 +0000
@@ -279,14 +279,14 @@
     int rate=0;
     int type=RSMP_INT;
     int sloppy=1;
-    sscanf((char*)arg,"%i:%i:%i", &rate, &type, &sloppy);
+    sscanf((char*)arg,"%i:%i:%i", &rate, &sloppy, &type);
     s->setup = (sloppy?FREQ_SLOPPY:FREQ_EXACT) | 
       (clamp(type,RSMP_LIN,RSMP_FLOAT));
     return af->control(af,AF_CONTROL_RESAMPLE_RATE | AF_CONTROL_SET, &rate);
   }
   case AF_CONTROL_POST_CREATE:	
     if((((af_cfg_t*)arg)->force & AF_INIT_FORMAT_MASK) == AF_INIT_FLOAT)
-      ((af_resample_t*)af->setup)->setup |= RSMP_FLOAT;
+      ((af_resample_t*)af->setup)->setup = RSMP_FLOAT;
     return AF_OK;
   case AF_CONTROL_RESAMPLE_RATE | AF_CONTROL_SET: 
     // Reinit must be called after this function has been called
--- a/libaf/af_volume.c	Fri Jan 10 01:01:38 2003 +0000
+++ b/libaf/af_volume.c	Fri Jan 10 01:45:34 2003 +0000
@@ -83,8 +83,8 @@
     return control(af,AF_CONTROL_VOLUME_LEVEL | AF_CONTROL_SET, vol);
   }
   case AF_CONTROL_POST_CREATE:	
-    s->fast = (((af_cfg_t*)arg)->force & AF_INIT_FORMAT_MASK) == 
-      AF_INIT_FLOAT ? 1 : 0;
+    s->fast = ((((af_cfg_t*)arg)->force & AF_INIT_FORMAT_MASK) == 
+      AF_INIT_FLOAT) ? 0 : 1;
     return AF_OK;
   case AF_CONTROL_VOLUME_ON_OFF | AF_CONTROL_SET:
     memcpy(s->enable,(int*)arg,AF_NCH*sizeof(int));
@@ -109,9 +109,12 @@
   case AF_CONTROL_PRE_DESTROY:{
     float m = 0.0;
     int i;
-    for(i=0;i<AF_NCH;i++)
-      m=max(m,s->max[i]);
-    af_msg(AF_MSG_INFO,"The maximum volume was %0.2fdB \n",10*log10(m));
+    if(!s->fast){
+      for(i=0;i<AF_NCH;i++)
+	m=max(m,s->max[i]);
+      af_msg(AF_MSG_INFO,"[volume] The maximum volume was %0.2fdB \n",
+	     10*log10(m));
+    }
     return AF_OK;
   }
   }