aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2008-09-27 22:21:32 -0700
committerEric Wong <normalperson@yhbt.net>2008-09-28 14:19:07 -0700
commit98f0bb23d71e94b3a6f12844ce4aec373f8701e8 (patch)
tree831d1d7c09c47014e622963b55ee05a2616f8e7b /src
parent7812cd9286fa7581b5ea18337e875ad98a2d8bd6 (diff)
downloadmpd-98f0bb23d71e94b3a6f12844ce4aec373f8701e8.tar.gz
mpd-98f0bb23d71e94b3a6f12844ce4aec373f8701e8.tar.xz
mpd-98f0bb23d71e94b3a6f12844ce4aec373f8701e8.zip
playlist: reset after we've hit the end
If repeat is off, we reset (and reshuffle in random mode) the playlist.
Diffstat (limited to 'src')
-rw-r--r--src/playlist.c6
1 files changed, 6 insertions, 0 deletions
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);