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;
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 */
}
/* 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
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 );