changeset 4882:d3af4699043f

equalizer: Fix incorrect math in equalizer_flow_set_bands(). (Closes: #70)
author William Pitcock <nenolod@atheme.org>
date Wed, 13 May 2009 03:00:17 -0500
parents a74ccf27f8f2
children f8e00917d6cc
files src/audlegacy/equalizer_flow.c
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/audlegacy/equalizer_flow.c	Tue May 05 17:00:13 2009 -0500
+++ b/src/audlegacy/equalizer_flow.c	Wed May 13 03:00:17 2009 -0500
@@ -90,16 +90,16 @@
         equalizer_open(eq);
     }
 
-    highest = - EQUALIZER_MAX_GAIN;
+    highest = EQUALIZER_MAX_GAIN;
     for (i = 0; i < 10; i ++) {
-       if (bands [i] > highest)
-          highest = bands [i];
+        if ((pre + bands[i]) > highest)
+            bands[i] -= (pre + bands[i]) - highest;
     }
     for (i = 0; i < 10; i ++)
-       adjusted [i] = pre + bands [i] - highest;
+        adjusted[i] = (bands[i] + pre);
 
     ctl.arg = adjusted;
-    for(i = 0; i < AF_NCH; i++) {
+    for (i = 0; i < AF_NCH; i++) {
         ctl.ch = i;
         eq->control(eq, AF_CONTROL_EQUALIZER_GAIN | AF_CONTROL_SET, &ctl);
     }