# HG changeset patch # User Kieran Clancy # Date 1188078832 -34200 # Node ID e2e875f3d02bf8652aa256bad72f706e24f75056 # Parent 880eea0813636de2666a7dd322b86f75774a0bb1 Make playlist_load_ins handle the case when playlist is not the currently active one diff -r 880eea081363 -r e2e875f3d02b src/audacious/playlist.c --- a/src/audacious/playlist.c Sun Aug 26 07:22:11 2007 +0930 +++ b/src/audacious/playlist.c Sun Aug 26 07:23:52 2007 +0930 @@ -1739,6 +1739,7 @@ playlist_load_ins(Playlist * playlist, const gchar * filename, gint pos) { PlaylistContainer *plc; + GList *old_iter; gchar *ext; gint old_len, new_len; @@ -1752,7 +1753,16 @@ g_return_val_if_fail(plc->plc_read != NULL, 0); old_len = playlist_get_length(playlist); - plc->plc_read(filename, pos); + /* make sure it adds files to the right playlist */ + if (playlist != playlist_get_active()) { + old_iter = playlists_iter; + playlists_iter = g_list_find(playlists, playlist); + if (!playlists_iter) playlists_iter = playlists; + plc->plc_read(filename, pos); + playlists_iter = old_iter; + } else { + plc->plc_read(filename, pos); + } new_len = playlist_get_length(playlist); playlist_generate_shuffle_list(playlist);