Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+11 -11
+11 -11
lib/rbcodec/dsp/eq.c
··· 71 71 /* Update the filter configuration for the band */ 72 72 void dsp_set_eq_coefs(int band, const struct eq_band_setting *setting) 73 73 { 74 - static void (* const coef_gen[EQ_NUM_BANDS])(unsigned long cutoff, 75 - unsigned long Q, long db, 76 - struct dsp_filter *f) = 77 - { 78 - [0] = filter_ls_coefs, 79 - [1 ... EQ_NUM_BANDS-2] = filter_pk_coefs, 80 - [EQ_NUM_BANDS-1] = filter_hs_coefs, 81 - }; 82 - 83 74 if (band < 0 || band >= EQ_NUM_BANDS) 84 75 return; 85 76 ··· 98 89 99 90 /* Convert user settings to format required by coef generator 100 91 functions */ 101 - coef_gen[band](0xffffffff / NATIVE_FREQUENCY * setting->cutoff, 102 - setting->q ?: 1, setting->gain, filter); 92 + void (* coef_gen)(unsigned long cutoff, unsigned long Q, long db, 93 + struct dsp_filter *f) = filter_pk_coefs; 94 + 95 + /* Only first and last bands are not peaking filters */ 96 + if (band == 0) 97 + coef_gen = filter_ls_coefs; 98 + else if (band == EQ_NUM_BANDS-1) 99 + coef_gen = filter_hs_coefs; 100 + 101 + coef_gen(0xffffffff / NATIVE_FREQUENCY * setting->cutoff, 102 + setting->q ?: 1, setting->gain, filter); 103 103 } 104 104 105 105 if (mask == eq_data.enabled)