Commit da8bdd62 authored by Max Kellermann's avatar Max Kellermann

PlaylistState: ignore "mixrampdelay:nan"

mixramp_delay==nan() causes severe problems with cross-fading.
parent 54abeab8
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include "ConfigGlobal.hxx" #include "ConfigGlobal.hxx"
#include "ConfigOption.hxx" #include "ConfigOption.hxx"
#include "fs/Limits.hxx" #include "fs/Limits.hxx"
#include "util/CharUtil.hxx"
#include "Log.hxx" #include "Log.hxx"
#include <glib.h> #include <glib.h>
...@@ -167,7 +168,12 @@ playlist_state_restore(const char *line, TextFile &file, ...@@ -167,7 +168,12 @@ playlist_state_restore(const char *line, TextFile &file,
} else if (g_str_has_prefix(line, PLAYLIST_STATE_FILE_MIXRAMPDB)) { } else if (g_str_has_prefix(line, PLAYLIST_STATE_FILE_MIXRAMPDB)) {
pc.SetMixRampDb(atof(line + strlen(PLAYLIST_STATE_FILE_MIXRAMPDB))); pc.SetMixRampDb(atof(line + strlen(PLAYLIST_STATE_FILE_MIXRAMPDB)));
} else if (g_str_has_prefix(line, PLAYLIST_STATE_FILE_MIXRAMPDELAY)) { } else if (g_str_has_prefix(line, PLAYLIST_STATE_FILE_MIXRAMPDELAY)) {
pc.SetMixRampDelay(atof(line + strlen(PLAYLIST_STATE_FILE_MIXRAMPDELAY))); const char *p = line + strlen(PLAYLIST_STATE_FILE_MIXRAMPDELAY);
/* this check discards "nan" which was used
prior to MPD 0.18 */
if (IsDigitASCII(*p))
pc.SetMixRampDelay(atof(p));
} else if (g_str_has_prefix(line, PLAYLIST_STATE_FILE_RANDOM)) { } else if (g_str_has_prefix(line, PLAYLIST_STATE_FILE_RANDOM)) {
random_mode = random_mode =
strcmp(line + strlen(PLAYLIST_STATE_FILE_RANDOM), strcmp(line + strlen(PLAYLIST_STATE_FILE_RANDOM),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment