diff options
author | 2011-05-03 20:56:36 +0200 | |
---|---|---|
committer | 2011-05-03 21:12:30 +0200 | |
commit | 921d55e1d5e4c300f27c39cf28047578454e8015 (patch) | |
tree | e8ced88d41e390e593fe22ccce228858e8e833eb /streamer.c | |
parent | 02af089e33fd4422185bfeb01b05ed76f7f05713 (diff) |
don't crash while importing 0.4.4 eq settings when supereq plugin is not available;
fixed importing of 0.4.4 settings
Diffstat (limited to 'streamer.c')
-rw-r--r-- | streamer.c | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -1456,14 +1456,20 @@ streamer_dsp_init (void) { streamer_dsp_postinit (); // load legacy eq settings from pre-0.5 - if (conf_find ("eq.", NULL)) { + if (eq && eqplug && conf_find ("eq.", NULL)) { eq->enabled = deadbeef->conf_get_int ("eq.enable", 0); char s[50]; - eqplug->set_param (eq, 0, (conf_get_str ("eq.preamp", "0", s, sizeof (s)), s)); + + // 0.4.4 was writing buggy settings, need to multiply by 2 to compensate + conf_get_str ("eq.preamp", "0", s, sizeof (s)); + snprintf (s, sizeof (s), "%f", atof(s)*2); + eqplug->set_param (eq, 0, s); for (int i = 0; i < 18; i++) { char key[100]; snprintf (key, sizeof (key), "eq.band%d", i); - eqplug->set_param (eq, 1+i, (conf_get_str (key, "0", s, sizeof (s)), s)); + conf_get_str (key, "0", s, sizeof (s)); + snprintf (s, sizeof (s), "%f", atof(s)*2); + eqplug->set_param (eq, 1+i, s); } // delete obsolete settings conf_remove_items ("eq."); |