aboutsummaryrefslogtreecommitdiffstats
path: root/src/playlist.c
diff options
context:
space:
mode:
authorQball Cow <qball@qballcow.nl>2006-05-08 08:15:24 +0000
committerQball Cow <qball@qballcow.nl>2006-05-08 08:15:24 +0000
commit151d9706e979ff8a511d853c71a29c7896d675bf (patch)
treeb7340ae1c0611a2d2f334281888cb8e6d1170f4f /src/playlist.c
parent37c92653575bb96b3fd44ea6c0ced930b6180e7f (diff)
downloadmpd-151d9706e979ff8a511d853c71a29c7896d675bf.tar.gz
mpd-151d9706e979ff8a511d853c71a29c7896d675bf.tar.xz
mpd-151d9706e979ff8a511d853c71a29c7896d675bf.zip
Commit Jat's patch for bug 1282
git-svn-id: https://svn.musicpd.org/mpd/trunk@4137 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/playlist.c')
-rw-r--r--src/playlist.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/playlist.c b/src/playlist.c
index 5f3c2c21a..b41cfcc4c 100644
--- a/src/playlist.c
+++ b/src/playlist.c
@@ -191,14 +191,14 @@ void initPlaylist() {
}
static int getNextId() {
- static int cur = 0;
+ static int cur = -1;
- while(playlist.idToPosition[cur] != -1) {
+ do {
cur++;
if(cur >= playlist_max_length*PLAYLIST_HASH_MULT) {
cur = 0;
}
- }
+ } while(playlist.idToPosition[cur] != -1);
return cur;
}