[MPlayer-cvslog] r35928 - trunk/libaf/af_volnorm.c

reimar subversion at mplayerhq.hu
Sat Mar 2 10:54:19 CET 2013


Author: reimar
Date: Sat Mar  2 10:54:18 2013
New Revision: 35928

Log:
Fix volnorm filter for float data.

Patch by Giorgio Vazzana [mywing81 gmail].

Modified:
   trunk/libaf/af_volnorm.c

Modified: trunk/libaf/af_volnorm.c
==============================================================================
--- trunk/libaf/af_volnorm.c	Thu Feb 28 12:19:59 2013	(r35927)
+++ trunk/libaf/af_volnorm.c	Sat Mar  2 10:54:18 2013	(r35928)
@@ -51,7 +51,7 @@
 // Silence level
 // FIXME: should be relative to the level of the samples
 #define SIL_S16 (SHRT_MAX * 0.01)
-#define SIL_FLOAT (INT_MAX * 0.01) // FIXME
+#define SIL_FLOAT (0.01) // FIXME
 
 // smooth must be in ]0.0, 1.0[
 #define SMOOTH_MUL 0.06
@@ -106,7 +106,7 @@ static int control(struct af_instance_s*
 	return AF_ERROR;
     s->method = i-1;
     s->mid_s16 = ((float)SHRT_MAX) * target;
-    s->mid_float = ((float)INT_MAX) * target;
+    s->mid_float = target;
     return AF_OK;
   }
   }
@@ -333,7 +333,7 @@ static int af_open(af_instance_t* af){
   ((af_volnorm_t*)af->setup)->lastavg = ((float)SHRT_MAX) * DEFAULT_TARGET;
   ((af_volnorm_t*)af->setup)->idx = 0;
   ((af_volnorm_t*)af->setup)->mid_s16 = ((float)SHRT_MAX) * DEFAULT_TARGET;
-  ((af_volnorm_t*)af->setup)->mid_float = ((float)INT_MAX) * DEFAULT_TARGET;
+  ((af_volnorm_t*)af->setup)->mid_float = DEFAULT_TARGET;
   for (i = 0; i < NSAMPLES; i++)
   {
      ((af_volnorm_t*)af->setup)->mem[i].len = 0;


More information about the MPlayer-cvslog mailing list