summaryrefslogtreecommitdiff
path: root/playlist.c
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2011-01-24 21:59:40 +0100
committerGravatar waker <wakeroid@gmail.com>2011-01-24 21:59:40 +0100
commit7f874f0e16d9b527869a0695fbaa6d78482c73d0 (patch)
tree56abe6385c3c097cd76e903a2c5800e2abdcb008 /playlist.c
parent35e543c8f7ed33c40d2c7b241c1eb20cc7524092 (diff)
deleting current playlist now attempts to select next playlist, before selecting previous
Diffstat (limited to 'playlist.c')
-rw-r--r--playlist.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/playlist.c b/playlist.c
index a9ae7b23..2205c0ef 100644
--- a/playlist.c
+++ b/playlist.c
@@ -409,12 +409,18 @@ plt_remove (int plt) {
prev->next = p->next;
}
}
+ playlist_t *next = p->next;
playlist_t *old = playlist;
playlist = p;
pl_clear ();
playlist = old;
if (p == playlist) {
- playlist = prev ? prev : playlists_head;
+ if (next) {
+ playlist = next;
+ }
+ else {
+ playlist = prev ? prev : playlists_head;
+ }
}
free (p->title);
free (p);