summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2012-12-28 14:12:18 -0500
committerMichael Sevakis <jethead71@rockbox.org>2012-12-28 14:12:18 -0500
commit362ade3892f40ee1b0360f3af1ab013a6ef32e5e (patch)
treee7c01540880a77efe4fcd308c28443fa2c562956 /lib
parent8ecbcad3d13d41ef9cff6d20149df1645f63aae0 (diff)
downloadrockbox-362ade3892f40ee1b0360f3af1ab013a6ef32e5e.zip
rockbox-362ade3892f40ee1b0360f3af1ab013a6ef32e5e.tar.gz
rockbox-362ade3892f40ee1b0360f3af1ab013a6ef32e5e.tar.bz2
rockbox-362ade3892f40ee1b0360f3af1ab013a6ef32e5e.tar.xz
Fix FS#12794 - new EQ code does not compile for the Nokia N8x0
The old GCC version currently required (sbox-arm-linux-gcc 3.4.4 release) apparently has trouble with function pointers used as static array initializers when using indexed initializers + ranges (ie. [A ... B] = fn). Change-Id: I494c2b607e4d93a9893264749d0ac257fb54ce3b
Diffstat (limited to 'lib')
-rw-r--r--lib/rbcodec/dsp/eq.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/rbcodec/dsp/eq.c b/lib/rbcodec/dsp/eq.c
index a9e200f..2e4b9af 100644
--- a/lib/rbcodec/dsp/eq.c
+++ b/lib/rbcodec/dsp/eq.c
@@ -71,15 +71,6 @@ void dsp_set_eq_precut(int precut)
/* Update the filter configuration for the band */
void dsp_set_eq_coefs(int band, const struct eq_band_setting *setting)
{
- static void (* const coef_gen[EQ_NUM_BANDS])(unsigned long cutoff,
- unsigned long Q, long db,
- struct dsp_filter *f) =
- {
- [0] = filter_ls_coefs,
- [1 ... EQ_NUM_BANDS-2] = filter_pk_coefs,
- [EQ_NUM_BANDS-1] = filter_hs_coefs,
- };
-
if (band < 0 || band >= EQ_NUM_BANDS)
return;
@@ -98,8 +89,17 @@ void dsp_set_eq_coefs(int band, const struct eq_band_setting *setting)
/* Convert user settings to format required by coef generator
functions */
- coef_gen[band](0xffffffff / NATIVE_FREQUENCY * setting->cutoff,
- setting->q ?: 1, setting->gain, filter);
+ void (* coef_gen)(unsigned long cutoff, unsigned long Q, long db,
+ struct dsp_filter *f) = filter_pk_coefs;
+
+ /* Only first and last bands are not peaking filters */
+ if (band == 0)
+ coef_gen = filter_ls_coefs;
+ else if (band == EQ_NUM_BANDS-1)
+ coef_gen = filter_hs_coefs;
+
+ coef_gen(0xffffffff / NATIVE_FREQUENCY * setting->cutoff,
+ setting->q ?: 1, setting->gain, filter);
}
if (mask == eq_data.enabled)