summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-10-30 22:32:21 +0100
committerMax Kellermann <max@duempel.org>2013-10-30 22:33:02 +0100
commitda8bdd62c86961a7fb3a72635e05c45203bd8e3c (patch)
tree700e0ad6b8a91e0fb14158719e32d7005b934b29 /src
parent54abeab80bff8e7d35a9fac6b1afdb64660df2e7 (diff)
PlaylistState: ignore "mixrampdelay:nan"
mixramp_delay==nan() causes severe problems with cross-fading.
Diffstat (limited to 'src')
-rw-r--r--src/PlaylistState.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/PlaylistState.cxx b/src/PlaylistState.cxx
index af89bc2d1..ac2deebbf 100644
--- a/src/PlaylistState.cxx
+++ b/src/PlaylistState.cxx
@@ -32,6 +32,7 @@
#include "ConfigGlobal.hxx"
#include "ConfigOption.hxx"
#include "fs/Limits.hxx"
+#include "util/CharUtil.hxx"
#include "Log.hxx"
#include <glib.h>
@@ -167,7 +168,12 @@ playlist_state_restore(const char *line, TextFile &file,
} else if (g_str_has_prefix(line, PLAYLIST_STATE_FILE_MIXRAMPDB)) {
pc.SetMixRampDb(atof(line + strlen(PLAYLIST_STATE_FILE_MIXRAMPDB)));
} 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)) {
random_mode =
strcmp(line + strlen(PLAYLIST_STATE_FILE_RANDOM),