comparison src/audacious/playlist.c @ 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 ae30eb582a66
children adc785ee517b
comparison
equal deleted inserted replaced
3458:2048a7c9572f 3473:3b26640f9fd6
280 } 280 }
281 281
282 void 282 void
283 playlist_remove_playlist(Playlist *playlist) 283 playlist_remove_playlist(Playlist *playlist)
284 { 284 {
285 gboolean active;
286 active = (playlist && playlist == playlist_get_active());
285 /* users suppose playback will be stopped on removing playlist */ 287 /* users suppose playback will be stopped on removing playlist */
286 if (playback_get_playing()) { 288 if (active && playback_get_playing()) {
287 ip_data.stop = TRUE; 289 ip_data.stop = TRUE;
288 playback_stop(); 290 playback_stop();
289 ip_data.stop = FALSE; 291 ip_data.stop = FALSE;
290 mainwin_clear_song_info(); 292 mainwin_clear_song_info();
291 } 293 }
295 playlist_clear(playlist); 297 playlist_clear(playlist);
296 playlist_set_current_name(playlist, NULL); 298 playlist_set_current_name(playlist, NULL);
297 return; 299 return;
298 } 300 }
299 301
300 if (playlist == playlist_get_active()) 302 if (active) playlist_select_next();
301 playlist_select_next();
302 303
303 /* upon removal, a playlist should be cleared and freed */ 304 /* upon removal, a playlist should be cleared and freed */
304 playlists = g_list_remove(playlists, playlist); 305 playlists = g_list_remove(playlists, playlist);
305 playlist_clear(playlist); 306 playlist_clear(playlist);
306 playlist_free(playlist); 307 playlist_free(playlist);