summaryrefslogtreecommitdiff
path: root/playlist.c
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2009-08-09 22:46:17 +0200
committerGravatar waker <wakeroid@gmail.com>2009-08-09 22:46:17 +0200
commitb7a27737d1ecf9b28ba5294dec29baa9cc6351eb (patch)
tree469bcba84f5c366dbf30f53d7331f86938b6eb58 /playlist.c
parentcdaa84065ba42c730991c22893ddc8c0d9ce7107 (diff)
fixed shuffle
Diffstat (limited to 'playlist.c')
-rw-r--r--playlist.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/playlist.c b/playlist.c
index ee162673..44239920 100644
--- a/playlist.c
+++ b/playlist.c
@@ -24,6 +24,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
+#include <assert.h>
#include "playlist.h"
#include "codec.h"
#include "cwav.h"
@@ -406,7 +407,10 @@ pl_remove (playItem_t *it) {
else {
playlist_head[PL_SHUFFLE] = next;
}
- if (!next) {
+ if (next) {
+ next->prev[PL_SHUFFLE] = prev;
+ }
+ else {
playlist_tail[PL_SHUFFLE] = prev;
}
}
@@ -518,6 +522,7 @@ pl_insert_item (playItem_t *after, playItem_t *it) {
}
else if (idx == pl_count-1) {
// append to end
+ assert (playlist_tail[PL_SHUFFLE]);
playlist_tail[PL_SHUFFLE]->next[PL_SHUFFLE] = it;
playlist_tail[PL_SHUFFLE] = it;
}