diff gui/dialog/url.c @ 36089:d4056035c260

Set file prior to adding to the URL list. An already existing URL list item won't be added, but the allocated url string will be freed (which thus can't be uiSetFile() nor be added to the playlist).
author ib
date Mon, 29 Apr 2013 12:10:03 +0000
parents 6500c354cd2c
children f658e29184e0
line wrap: on
line diff
--- a/gui/dialog/url.c	Mon Apr 29 12:03:51 2013 +0000
+++ b/gui/dialog/url.c	Mon Apr 29 12:10:03 2013 +0000
@@ -61,13 +61,14 @@
             }
 
             if (str) {
+                uiSetFile(NULL, str, STREAMTYPE_STREAM);
+                listMgr(PLAYLIST_DELETE, 0);
+                add_to_gui_playlist(str, PLAYLIST_ITEM_APPEND);
+
                 item      = calloc(1, sizeof(urlItem));
                 item->url = str;
                 listMgr(URLLIST_ITEM_ADD, item);
 
-                uiSetFile(NULL, str, STREAMTYPE_STREAM);
-                listMgr(PLAYLIST_DELETE, 0);
-                add_to_gui_playlist(str, PLAYLIST_ITEM_APPEND);
                 guiInfo.NewPlay = GUI_FILE_NEW;
                 uiEvent(evPlay, 0);
             }