diff options
author | Max Kellermann <max@musicpd.org> | 2018-02-11 13:22:43 +0100 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2018-02-11 13:22:43 +0100 |
commit | 65bbb0e0aa0f613a9da683900838d2912f2454ba (patch) | |
tree | 3527ff6fdec933826a9278a611166d4b69f14827 /src/queue | |
parent | 5147654f6c6e452132be6bd4b8d525d1c1856878 (diff) | |
parent | c2940a8385201b6501a43aefa6f9bee983950c01 (diff) |
Merge tag 'v0.20.17'
release v0.20.17
Diffstat (limited to 'src/queue')
-rw-r--r-- | src/queue/PlaylistState.cxx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/queue/PlaylistState.cxx b/src/queue/PlaylistState.cxx index d08610efc..614f01c19 100644 --- a/src/queue/PlaylistState.cxx +++ b/src/queue/PlaylistState.cxx @@ -35,6 +35,7 @@ #include "util/CharUtil.hxx" #include "util/StringAPI.hxx" #include "util/StringCompare.hxx" +#include "util/NumberParser.hxx" #include "Log.hxx" #include <string.h> @@ -148,7 +149,7 @@ playlist_state_restore(const char *line, TextFile &file, while ((line = file.ReadLine()) != nullptr) { const char *p; if ((p = StringAfterPrefix(line, PLAYLIST_STATE_FILE_TIME))) { - seek_time = SongTime::FromS(atof(p)); + seek_time = SongTime::FromS(ParseDouble(p)); } else if ((p = StringAfterPrefix(line, PLAYLIST_STATE_FILE_REPEAT))) { playlist.SetRepeat(pc, StringIsEqual(p, "1")); } else if ((p = StringAfterPrefix(line, PLAYLIST_STATE_FILE_SINGLE))) { @@ -158,12 +159,12 @@ playlist_state_restore(const char *line, TextFile &file, } else if ((p = StringAfterPrefix(line, PLAYLIST_STATE_FILE_CROSSFADE))) { pc.SetCrossFade(atoi(p)); } else if ((p = StringAfterPrefix(line, PLAYLIST_STATE_FILE_MIXRAMPDB))) { - pc.SetMixRampDb(atof(p)); + pc.SetMixRampDb(ParseFloat(p)); } else if ((p = StringAfterPrefix(line, PLAYLIST_STATE_FILE_MIXRAMPDELAY))) { /* this check discards "nan" which was used prior to MPD 0.18 */ if (IsDigitASCII(*p)) - pc.SetMixRampDelay(atof(p)); + pc.SetMixRampDelay(ParseFloat(p)); } else if ((p = StringAfterPrefix(line, PLAYLIST_STATE_FILE_RANDOM))) { random_mode = StringIsEqual(p, "1"); } else if ((p = StringAfterPrefix(line, PLAYLIST_STATE_FILE_CURRENT))) { |