From adc11cb8aaae08debe5939596f8430a511dbcd34 Mon Sep 17 00:00:00 2001 From: Warren Dukes Date: Tue, 8 Jun 2004 20:16:28 +0000 Subject: [PATCH] on random select, move current to the first song played git-svn-id: https://svn.musicpd.org/mpd/trunk@1401 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- src/playlist.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/playlist.c b/src/playlist.c index 911291ff7..75943f33d 100644 --- a/src/playlist.c +++ b/src/playlist.c @@ -1046,6 +1046,11 @@ int setPlaylistRandomStatus(FILE * fp, int status) { playlist.length-1); } else */randomizeOrder(0,playlist.length-1); + if(playlist.current >= 0 && + playlist.current < playlist.length) + { + swapOrder(playlist.current, 0); + } } else orderPlaylist(); }