From 42581bea4f25224784686fff339ccc269abcfa4a Mon Sep 17 00:00:00 2001 From: karlstav Date: Sun, 22 Mar 2020 23:08:57 +0100 Subject: [PATCH] #338 fix default eq --- cava.c | 5 +++-- config.c | 2 -- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/cava.c b/cava.c index 4186563..8a3bd7c 100644 --- a/cava.c +++ b/cava.c @@ -626,7 +626,7 @@ as of 0.4.0 all options are specified in config file, see in '/home/username/.co if (p.stereo) bars = bars / 2; // in stereo onle half number of bars per channel - if ((p.smcount > 0) && (bars > 0)) { + if (p.customEQ && (bars > 0)) { smh = (double)(((double)p.smcount) / ((double)bars)); } @@ -651,7 +651,8 @@ as of 0.4.0 all options are specified in config file, see in '/home/username/.co k[n] = pow(fc[n], 1); k[n] *= (float)height / pow(2, 28); - k[n] *= p.smooth[(int)floor(((double)n) * smh)]; + if(p.customEQ) + k[n] *= p.smooth[(int)floor(((double)n) * smh)]; k[n] /= log2(audio.FFTbassbufferSize); // lfc stores the lower cut frequency foo each bar in the fft out buffer if (fc[n] < bass_cut_off) { diff --git a/config.c b/config.c index a5dad0c..cc79e2c 100644 --- a/config.c +++ b/config.c @@ -456,7 +456,6 @@ bool load_config(char configPath[PATH_MAX], struct config_params *p, bool colors p->bit_format = iniparser_getint(ini, "output:bit_format", 16); // read & validate: eq - p->smooth = smoothDef; p->smcount = iniparser_getsecnkeys(ini, "eq"); if (p->smcount > 0) { p->customEQ = 1; @@ -473,7 +472,6 @@ bool load_config(char configPath[PATH_MAX], struct config_params *p, bool colors } } else { p->customEQ = 0; - p->smcount = sizeof(smoothDef) / sizeof(smoothDef[0]); // back to the default one } free(p->audio_source);