X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fdemux%2Fplaylist%2Fpodcast.c;h=df6736e1ea498417079bb562dded31363611c4ca;hb=5f118ca94b8b9e25b78e72e781c94fb2376541bb;hp=1cfbb1ab12f8af8698662f3d820e03569b449287;hpb=c2538e2665dbc63294bc7949d913cb044851d00e;p=vlc diff --git a/modules/demux/playlist/podcast.c b/modules/demux/playlist/podcast.c index 1cfbb1ab12..df6736e1ea 100644 --- a/modules/demux/playlist/podcast.c +++ b/modules/demux/playlist/podcast.c @@ -74,7 +74,7 @@ static int Demux( demux_t *p_demux ) int i_ret; xml_t *p_xml; - xml_reader_t *p_xml_reader; + xml_reader_t *p_xml_reader = NULL; char *psz_elname = NULL; char *psz_item_mrl = NULL; char *psz_item_size = NULL; @@ -90,8 +90,9 @@ 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; - INIT_PLAYLIST_STUFF; + input_item_t *p_current_input = GetCurrentItem(p_demux); p_xml = xml_Create( p_demux ); if( !p_xml ) @@ -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,7 +368,8 @@ static int Demux( demux_t *p_demux ) xml_ReaderDelete( p_xml, p_xml_reader ); xml_Delete( p_xml ); - HANDLE_PLAY_AND_RELEASE; + input_item_node_PostAndDelete( p_subitems ); + vlc_gc_decref(p_current_input); return 0; /* Needed for correct operation of go back */ error: @@ -385,8 +391,10 @@ error: xml_ReaderDelete( p_xml, p_xml_reader ); if( p_xml ) xml_Delete( p_xml ); + if( p_subitems ) + input_item_node_Delete( p_subitems ); - HANDLE_PLAY_AND_RELEASE; + vlc_gc_decref(p_current_input); return -1; }