Skip to content

Commit

Permalink
Revert "Equalizer: check if requested gain has changed before updating"
Browse files Browse the repository at this point in the history
This reverts commit 78e8d60.
  • Loading branch information
digidocs committed Sep 4, 2024
1 parent 78e8d60 commit 57cd009
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions components/squeezelite/equalizer.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,28 +148,18 @@ void equalizer_set_volume(unsigned left, unsigned right) {
*/
void equalizer_set_gain(int8_t *gain) {
#if BYTES_PER_FRAME == 4
static uint8_t last_gain[EQ_BANDS] = { };
bool eq_update = false;

char config[EQ_BANDS * 4 + 1] = { };
int n = 0;

for (int i = 0; i < EQ_BANDS; i++) {
equalizer.gain[i] = gain[i];
n += sprintf(config + n, "%d,", gain[i]);

if (gain[i] != last_gain[i])
{
eq_update = true;
}
last_gain[i] = gain[i];
}

config[n-1] = '\0';
config_set_value(NVS_TYPE_STR, "equalizer", config);

//"or" in this value in case equalizer.update is set for another reason
equalizer.update |= eq_update;
equalizer.update = true;

LOG_INFO("equalizer gain %s", config);
#else
Expand Down

0 comments on commit 57cd009

Please sign in to comment.