From fbbbd7436a347595e925c5ba8b69e8875b5c73bc Mon Sep 17 00:00:00 2001 From: Alexey Yakovenko Date: Tue, 4 Aug 2009 22:03:54 +0200 Subject: fixed playlist insertion --- playlist.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'playlist.c') 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; } -- cgit v1.2.3