summaryrefslogtreecommitdiff
path: root/playlist.c
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <wakeroid@gmail.com>2009-08-04 22:03:54 +0200
committerGravatar Alexey Yakovenko <wakeroid@gmail.com>2009-08-04 22:03:54 +0200
commitfbbbd7436a347595e925c5ba8b69e8875b5c73bc (patch)
treed01626b2c77327a6caebbc54c7acbae1eb11159d /playlist.c
parent7bccab7d4a27e554259637f4ed23356519433549 (diff)
fixed playlist insertion
Diffstat (limited to 'playlist.c')
-rw-r--r--playlist.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/playlist.c b/playlist.c
index d91af9cf..0cb2c21e 100644
--- a/playlist.c
+++ b/playlist.c
@@ -526,16 +526,17 @@ ps_insert_item (playItem_t *after, playItem_t *it) {
playlist_head = it;
}
else {
- it->next = after;
- it->prev = after->prev;
- if (after->prev) {
- after->prev->next = it;
+ it->prev= after;
+ it->next = after->next;
+ if (after->next) {
+ after->next->prev = it;
}
- after->prev = it;
+ after->next = it;
if (after == playlist_tail) {
playlist_tail = it;
}
}
+ ps_count++;
return it;
}