# HG changeset patch # User William Pitcock # Date 1242201617 18000 # Node ID d3af4699043fb353c864aba44c8baae9c46f897a # Parent a74ccf27f8f2a95d197062e13037cab57f9fa75a equalizer: Fix incorrect math in equalizer_flow_set_bands(). (Closes: #70) diff -r a74ccf27f8f2 -r d3af4699043f src/audlegacy/equalizer_flow.c --- 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); }