]> git.sesse.net Git - vlc/commitdiff
xspf: Don't nop item->psz_nam
authorDerk-Jan Hartman <hartman@videolan.org>
Thu, 25 Jun 2009 13:48:25 +0000 (15:48 +0200)
committerDerk-Jan Hartman <hartman@videolan.org>
Thu, 25 Jun 2009 14:17:01 +0000 (16:17 +0200)
Set the nop at the end of parsing, instead of the beginning, because SetURI will only init the name once. Now we had all media library items with the title "nop".

modules/demux/playlist/xspf.c

index 938ecfee48792c44cd64f47aff692601486b6351..d79e874f909ca5ee0a8929b8098ed61f18e565fd 100644 (file)
@@ -416,7 +416,7 @@ static bool parse_track_node COMPLEX_INTERFACE
           {NULL,           UNKNOWN_CONTENT, {NULL} }
         };
 
-    input_item_t *p_new_input = input_item_New( p_demux, "vlc://nop", NULL );
+    input_item_t *p_new_input = input_item_New( p_demux, NULL, NULL );
 
     if( !p_new_input )
     {
@@ -503,11 +503,20 @@ static bool parse_track_node COMPLEX_INTERFACE
                     FREE_ATT();
                     return false;
                 }
+
                 /* leave if the current parent node <track> is terminated */
                 if( !strcmp( psz_name, psz_element ) )
                 {
                     FREE_ATT();
 
+                    /* Make sure we have a URI */
+                    char *psz_uri = input_item_GetURI( p_new_input );
+                    if( !psz_uri )
+                    {
+                        input_item_SetURI( p_new_input, "vlc://nop" );
+                    }
+                    free( psz_uri );
+
                     if( p_demux->p_sys->i_track_id < 0 )
                     {
                         input_item_AddSubItem( p_input_item, p_new_input );