int Demux( demux_t *p_demux )
{
int i_ret = -1;
- xml_t *p_xml = NULL;
xml_reader_t *p_xml_reader = NULL;
char *psz_name = NULL;
input_item_t *p_current_input = GetCurrentItem(p_demux);
p_demux->p_sys->psz_base = NULL;
/* create new xml parser from stream */
- p_xml = xml_Create( p_demux );
- if( !p_xml )
- goto end;
-
- p_xml_reader = xml_ReaderCreate( p_xml, p_demux->s );
+ p_xml_reader = xml_ReaderCreate( p_demux, p_demux->s );
if( !p_xml_reader )
goto end;
input_item_t *p_new_input = p_demux->p_sys->pp_tracklist[i];
if( p_new_input )
{
- input_item_AddSubItem( p_current_input, p_new_input );
input_item_node_AppendItem( p_subitems, p_new_input );
}
}
- input_item_AddSubItemTree( p_subitems );
- input_item_node_Delete( p_subitems );
+ input_item_node_PostAndDelete( p_subitems );
end:
vlc_gc_decref(p_current_input);
if( p_xml_reader )
- xml_ReaderDelete( p_xml, p_xml_reader );
- if( p_xml )
- xml_Delete( p_xml );
+ xml_ReaderDelete( p_xml_reader );
return i_ret; /* Needed for correct operation of go back */
}
if( p_sys->i_track_id < 0 )
{
- input_item_AddSubItem( p_input_item, p_new_input );
input_item_node_AppendNode( p_input_node, p_new_node );
vlc_gc_decref( p_new_input );
return true;
/* special case: location */
if( !strcmp( p_handler->name, "location" ) )
{
+ if( psz_value == NULL )
+ input_item_SetURI( p_new_input, "vlc://nop" );
+ else
/* FIXME: This is broken. Scheme-relative (//...) locations
* and anchors (#...) are not resolved correctly. Also,
* host-relative (/...) and directory-relative locations
ITEM_TYPE_DIRECTORY );
if( p_new_input )
{
- input_item_AddSubItem( p_input_item, p_new_input );
p_input_node =
input_item_node_AppendItem( p_input_node, p_new_input );
p_input_item = p_new_input;
msg_Warn( p_demux, "<extension> requires \"application\" attribute" );
return false;
}
+ /* Skip the extension if the application is not vlc
+ This will skip all children of the current node */
else if( strcmp( psz_application, "http://www.videolan.org/vlc/playlist/0" ) )
{
msg_Dbg( p_demux, "Skipping \"%s\" extension tag", psz_application );
free( psz_application );
- return false;
+ /* Skip all children */
+ while( xml_ReaderRead( p_xml_reader ) == 1 )
+ {
+ if( xml_ReaderNodeType( p_xml_reader ) == XML_READER_ENDELEM )
+ {
+ char *psz_name = xml_ReaderName( p_xml_reader );
+ if( !strcmp( psz_name, "extension" ) )
+ {
+ free( psz_name );
+ break;
+ }
+ msg_Dbg( p_demux, "\tskipping \"%s\" extension child", psz_name );
+ free( psz_name );
+ }
+ }
+ return true;
}
}
free( psz_application );
p_new_input = p_demux->p_sys->pp_tracklist[ i_tid ];
if( p_new_input )
{
- input_item_AddSubItem( p_input_node->p_item, p_new_input );
input_item_node_AppendItem( p_input_node, p_new_input );
vlc_gc_decref( p_new_input );
p_demux->p_sys->pp_tracklist[i_tid] = NULL;