]> git.sesse.net Git - vlc/blobdiff - modules/demux/playlist/xspf.c
Remove trailing spaces.
[vlc] / modules / demux / playlist / xspf.c
index a0d308cd8330973ed1858fac83dc018f6f0f2039..a6b1cbeed1170a041ded4fdda7cb1480fe085616 100644 (file)
@@ -136,7 +136,7 @@ int Demux( demux_t *p_demux )
         input_item_t *p_new_input = p_demux->p_sys->pp_tracklist[i];
         if( p_new_input )
         {
-            input_ItemAddSubItem( p_current_input, p_new_input );
+            input_item_AddSubItem( p_current_input, p_new_input );
         }
     }
 
@@ -558,10 +558,10 @@ static bool parse_track_node COMPLEX_INTERFACE
                            free( psz_uri );
                            psz_uri = psz_tmp;
                         }
-                        p_new_input = input_ItemNewExt( p_demux, psz_uri,
+                        p_new_input = input_item_NewExt( p_demux, psz_uri,
                                                         NULL, 0, NULL, -1 );
                         free( psz_uri );
-                        input_ItemCopyOptions( p_input_item, p_new_input );
+                        input_item_CopyOptions( p_input_item, p_new_input );
                         psz_uri = NULL;
                         FREE_ATT();
                         p_handler = NULL;
@@ -671,9 +671,9 @@ static bool set_option SIMPLE_INTERFACE
 
     /* re-convert xml special characters inside psz_value */
     resolve_xml_special_chars( psz_value );
-    
-    input_ItemAddOpt( p_input, psz_value, 0 );
-    
+
+    input_item_AddOpt( p_input, psz_value, 0 );
+
     return true;
 }
 
@@ -687,6 +687,7 @@ static bool parse_extension_node COMPLEX_INTERFACE
     char *psz_title = NULL;
     char *psz_application = NULL;
     int i_node;
+    bool b_release_input_item = false;
     xml_elem_hnd_t *p_handler = NULL;
     input_item_t *p_new_input = NULL;
 
@@ -734,13 +735,13 @@ static bool parse_extension_node COMPLEX_INTERFACE
             msg_Warn( p_demux, "<node> requires \"title\" attribute" );
             return false;
         }
-        p_new_input = input_ItemNewWithType( VLC_OBJECT( p_demux ), "vlc://nop",
+        p_new_input = input_item_NewWithType( VLC_OBJECT( p_demux ), "vlc://nop",
                                 psz_title, 0, NULL, -1, ITEM_TYPE_DIRECTORY );
         if( p_new_input )
         {
-            input_ItemAddSubItem( p_input_item, p_new_input );
+            input_item_AddSubItem( p_input_item, p_new_input );
             p_input_item = p_new_input;
-            vlc_gc_decref( p_new_input );
+            b_release_input_item = true;
         }
         free( psz_title );
     }
@@ -775,6 +776,7 @@ static bool parse_extension_node COMPLEX_INTERFACE
                 {
                     msg_Err( p_demux, "invalid xml stream" );
                     FREE_ATT();
+                    if(b_release_input_item) vlc_gc_decref( p_new_input );
                     return false;
                 }
                 /* choose handler */
@@ -785,6 +787,7 @@ static bool parse_extension_node COMPLEX_INTERFACE
                 {
                     msg_Err( p_demux, "unexpected element <%s>", psz_name );
                     FREE_ATT();
+                    if(b_release_input_item) vlc_gc_decref( p_new_input );
                     return false;
                 }
                 FREE_NAME();
@@ -802,6 +805,7 @@ static bool parse_extension_node COMPLEX_INTERFACE
                     else
                     {
                         FREE_ATT();
+                        if(b_release_input_item) vlc_gc_decref( p_new_input );
                         return false;
                     }
                 }
@@ -815,6 +819,7 @@ static bool parse_extension_node COMPLEX_INTERFACE
                 {
                     msg_Err( p_demux, "invalid xml stream" );
                     FREE_ATT();
+                    if(b_release_input_item) vlc_gc_decref( p_new_input );
                     return false;
                 }
                 break;
@@ -826,12 +831,14 @@ static bool parse_extension_node COMPLEX_INTERFACE
                 {
                     msg_Err( p_demux, "invalid xml stream" );
                     FREE_ATT();
+                    if(b_release_input_item) vlc_gc_decref( p_new_input );
                     return false;
                 }
                 /* leave if the current parent node is terminated */
                 if( !strcmp( psz_name, psz_element ) )
                 {
                     FREE_ATT();
+                    if(b_release_input_item) vlc_gc_decref( p_new_input );
                     return true;
                 }
                 /* there MUST have been a start tag for that element name */
@@ -841,6 +848,7 @@ static bool parse_extension_node COMPLEX_INTERFACE
                     msg_Err( p_demux, "there's no open element left for <%s>",
                              psz_name );
                     FREE_ATT();
+                    if(b_release_input_item) vlc_gc_decref( p_new_input );
                     return false;
                 }
 
@@ -857,10 +865,12 @@ static bool parse_extension_node COMPLEX_INTERFACE
                 /* unknown/unexpected xml node */
                 msg_Err( p_demux, "unexpected xml node %i", i_node );
                 FREE_ATT();
+                if(b_release_input_item) vlc_gc_decref( p_new_input );
                 return false;
         }
         FREE_NAME();
     }
+    if(b_release_input_item) vlc_gc_decref( p_new_input );
     return false;
 }
 
@@ -914,7 +924,7 @@ static bool parse_extitem_node COMPLEX_INTERFACE
     p_new_input = p_demux->p_sys->pp_tracklist[ i_href ];
     if( p_new_input )
     {
-        input_ItemAddSubItem( p_input_item, p_new_input );
+        input_item_AddSubItem( p_input_item, p_new_input );
         vlc_gc_decref( p_new_input );
         p_demux->p_sys->pp_tracklist[i_href] = NULL;
     }