aboutsummaryrefslogtreecommitdiffstats
path: root/src/queue/PlaylistState.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-08-27 19:11:55 +0200
committerMax Kellermann <max@duempel.org>2014-08-28 06:42:19 +0200
commit39529204925c95c1ae38fee25df334f3c3a1a4a7 (patch)
tree80265280e7557858814158b7ea0a6f5f65be8847 /src/queue/PlaylistState.cxx
parentc2001a725978b665f0b22a4ad3865293754efd38 (diff)
downloadmpd-39529204925c95c1ae38fee25df334f3c3a1a4a7.tar.gz
mpd-39529204925c95c1ae38fee25df334f3c3a1a4a7.tar.xz
mpd-39529204925c95c1ae38fee25df334f3c3a1a4a7.zip
Playlist: use std::chrono::duration for Seek*()
Diffstat (limited to 'src/queue/PlaylistState.cxx')
-rw-r--r--src/queue/PlaylistState.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/queue/PlaylistState.cxx b/src/queue/PlaylistState.cxx
index 18d8c9dc5..316a0767f 100644
--- a/src/queue/PlaylistState.cxx
+++ b/src/queue/PlaylistState.cxx
@@ -132,7 +132,7 @@ playlist_state_restore(const char *line, TextFile &file,
struct playlist &playlist, PlayerControl &pc)
{
int current = -1;
- int seek_time = 0;
+ SongTime seek_time = SongTime::zero();
bool random_mode = false;
if (!StringStartsWith(line, PLAYLIST_STATE_FILE_STATE))
@@ -150,8 +150,8 @@ playlist_state_restore(const char *line, TextFile &file,
while ((line = file.ReadLine()) != nullptr) {
if (StringStartsWith(line, PLAYLIST_STATE_FILE_TIME)) {
- seek_time =
- atoi(&(line[strlen(PLAYLIST_STATE_FILE_TIME)]));
+ unsigned seconds = atoi(&(line[strlen(PLAYLIST_STATE_FILE_TIME)]));
+ seek_time = SongTime::FromS(seconds);
} else if (StringStartsWith(line, PLAYLIST_STATE_FILE_REPEAT)) {
playlist.SetRepeat(pc,
strcmp(&(line[strlen(PLAYLIST_STATE_FILE_REPEAT)]),
@@ -209,7 +209,7 @@ playlist_state_restore(const char *line, TextFile &file,
if (state == PlayerState::STOP /* && config_option */)
playlist.current = current;
- else if (seek_time == 0)
+ else if (seek_time.count() == 0)
playlist.PlayPosition(pc, current);
else
playlist.SeekSongPosition(pc, current, seek_time);