]> git.sesse.net Git - vlc/blobdiff - modules/demux/playlist/podcast.c
Split Avutil<->VLC chroma conversions functions from avcodec.h so that swscale doesn...
[vlc] / modules / demux / playlist / podcast.c
index 3c255e424af903b4fa1ba5799596af30ffb05b96..df6736e1ea498417079bb562dded31363611c4ca 100644 (file)
@@ -90,6 +90,7 @@ static int Demux( demux_t *p_demux )
     char *psz_art_url = NULL;
     int i_type;
     input_item_t *p_input;
+    input_item_node_t *p_subitems = NULL;
 
     input_item_t *p_current_input = GetCurrentItem(p_demux);
 
@@ -128,6 +129,8 @@ static int Demux( demux_t *p_demux )
     }
     FREENULL( psz_elname );
 
+    p_subitems = input_item_node_Create( p_current_input );
+
     while( (i_ret = xml_ReaderRead( p_xml_reader )) == 1 )
     {
         // Get the node type
@@ -186,14 +189,14 @@ static int Demux( demux_t *p_demux )
                         }
                         else
                         {
-                            msg_Dbg( p_demux,"unhandled attribure %s in element %s",
+                            msg_Dbg( p_demux,"unhandled attribute %s in element %s",
                                      psz_name, psz_elname );
                             free( psz_value );
                         }
                     }
                     else
                     {
-                        msg_Dbg( p_demux,"unhandled attribure %s in element %s",
+                        msg_Dbg( p_demux,"unhandled attribute %s in element %s",
                                   psz_name, psz_elname );
                         free( psz_value );
                     }
@@ -203,6 +206,8 @@ static int Demux( demux_t *p_demux )
             }
             case XML_READER_TEXT:
             {
+                if(!psz_elname) break;
+
                 char *psz_text = xml_ReaderValue( p_xml_reader );
 
 #define SET_DATA( field, name )                 \
@@ -326,7 +331,7 @@ static int Demux( demux_t *p_demux )
                                                 "%s bytes",
                                                 psz_item_size );
                     }
-                    input_item_AddSubItem( p_current_input, p_input );
+                    input_item_node_AppendItem( p_subitems, p_input );
                     vlc_gc_decref( p_input );
                     FREENULL( psz_item_name );
                     FREENULL( psz_item_mrl );
@@ -363,6 +368,7 @@ static int Demux( demux_t *p_demux )
     xml_ReaderDelete( p_xml, p_xml_reader );
     xml_Delete( p_xml );
 
+    input_item_node_PostAndDelete( p_subitems );
     vlc_gc_decref(p_current_input);
     return 0; /* Needed for correct operation of go back */
 
@@ -385,6 +391,8 @@ error:
         xml_ReaderDelete( p_xml, p_xml_reader );
     if( p_xml )
         xml_Delete( p_xml );
+    if( p_subitems )
+        input_item_node_Delete( p_subitems );
 
     vlc_gc_decref(p_current_input);
     return -1;