changeset 3473:3b26640f9fd6 trunk

Don't stop playback when deleting a non-active playlist
author Kieran Clancy <clancy.kieran+audacious@gmail.com>
date Mon, 10 Sep 2007 13:44:49 +0930
parents 2048a7c9572f
children adc785ee517b
files src/audacious/playlist.c
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/audacious/playlist.c	Fri Sep 07 22:26:42 2007 -0500
+++ b/src/audacious/playlist.c	Mon Sep 10 13:44:49 2007 +0930
@@ -282,8 +282,10 @@
 void
 playlist_remove_playlist(Playlist *playlist)
 {
+    gboolean active;
+    active = (playlist && playlist == playlist_get_active());
     /* users suppose playback will be stopped on removing playlist */
-    if (playback_get_playing()) {
+    if (active && playback_get_playing()) {
         ip_data.stop = TRUE;
         playback_stop();
         ip_data.stop = FALSE;
@@ -297,8 +299,7 @@
         return;
     }
 
-    if (playlist == playlist_get_active())
-        playlist_select_next();
+    if (active) playlist_select_next();
 
     /* upon removal, a playlist should be cleared and freed */
     playlists = g_list_remove(playlists, playlist);