From 98f0bb23d71e94b3a6f12844ce4aec373f8701e8 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 27 Sep 2008 22:21:32 -0700 Subject: playlist: reset after we've hit the end If repeat is off, we reset (and reshuffle in random mode) the playlist. --- src/playlist.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/playlist.c b/src/playlist.c index 8b7416d2e..c6a918201 100644 --- a/src/playlist.c +++ b/src/playlist.c @@ -515,6 +515,12 @@ static void queueNextSongInPlaylist(void) pthread_mutex_unlock(&queue_lock); if (playlist.queued < 0) { playlist_state = PLAYLIST_STATE_STOP; + if (playlist.length > 0) { + if (playlist.random) + randomizeOrder(0, playlist.length - 1); + else + playlist.current = -1; + } } else if (dc.state == DC_STATE_STOP) { /* DEBUG("%s:%d (%d)\n", __func__, __LINE__, playlist.queued);*/ dc_trigger_action(DC_ACTION_START, 0); -- cgit v1.2.3