if( !strcmp( psz_name, psz_element ) )
{
FREE_ATT();
- input_ItemAddSubItem( p_input_item, p_new_input );
if( p_demux->p_sys->i_identifier <
p_demux->p_sys->i_tracklist_entries )
{
char *psz_application = NULL;
int i_node;
xml_elem_hnd_t *p_handler = NULL;
+ input_item_t *p_new_input = NULL;
xml_elem_hnd_t pl_elements[] =
{ {"node", COMPLEX_CONTENT, {.cmplx = parse_extension_node} },
}
/* attribute title is mandatory except for <extension> */
- if( !strcmp( psz_element, "node" ) && !psz_title )
+ if( !strcmp( psz_element, "node" ) )
{
- msg_Warn( p_demux, "<node> requires \"title\" attribute" );
- return VLC_FALSE;
- }
- free( psz_title );
+ if( !psz_title )
+ {
+ msg_Warn( p_demux, "<node> requires \"title\" attribute" );
+ return VLC_FALSE;
+ }
- if( !strcmp( psz_element, "extension" ) )
+ p_new_input = input_ItemNewWithType( p_playlist, "", psz_title,
+ 0, NULL, -1, ITEM_TYPE_DIRECTORY );
+ if( p_new_input )
+ {
+ input_ItemAddSubItem( p_input_item, p_new_input );
+ p_input_item = p_new_input;
+ }
+ free( psz_title );
+ }
+ else if( !strcmp( psz_element, "extension" ) )
{
if( !psz_application )
{
*/
static vlc_bool_t parse_extitem_node COMPLEX_INTERFACE
{
+ input_item_t *p_new_input = NULL;
char *psz_name = NULL;
char *psz_value = NULL;
int i_href = -1;
return VLC_FALSE;
}
- /* XXX: We can't check the validity of the 'href' attribute if we do parse
- the extension before the TrackList
if( i_href > p_demux->p_sys->i_tracklist_entries )
{
msg_Warn( p_demux, "invalid \"href\" attribute" );
return VLC_FALSE;
- }*/
+ }
+
+ p_new_input = p_demux->p_sys->pp_tracklist[ i_href ];
+ if( p_new_input )
+ {
+ input_ItemAddSubItem( p_input_item, p_new_input );
+ }
/* fix for #1293 - XTAG sends ENDELEM for self closing tag */
/* (libxml sends NONE) */
free( psz_temp );
}
- /* export the tree structure in <extension> */
- fprintf( p_export->p_file, "\t<extension application=\"http://www.videolan.org/vlc/playlist/0\">\n" );
- i_count = 0;
- for( i = 0; i < p_node->i_children; i++ )
- {
- xspf_extension_item( p_node->pp_children[i], p_export->p_file,
- &i_count );
- }
- fprintf( p_export->p_file, "\t</extension>\n" );
-
/* export all items in a flat format */
fprintf( p_export->p_file, "\t<trackList>\n" );
i_count = 0;
}
fprintf( p_export->p_file, "\t</trackList>\n" );
+ /* export the tree structure in <extension> */
+ fprintf( p_export->p_file, "\t<extension application=\"http://www.videolan.org/vlc/playlist/0\">\n" );
+ i_count = 0;
+ for( i = 0; i < p_node->i_children; i++ )
+ {
+ xspf_extension_item( p_node->pp_children[i], p_export->p_file,
+ &i_count );
+ }
+ fprintf( p_export->p_file, "\t</extension>\n" );
+
/* close the header elements */
fprintf( p_export->p_file, "</playlist>\n" );
/* The media library input has one and only one option: "meta-file"
* So we remove that unneeded option. */
- free( p_item->ppsz_options[0] );
- p_item->i_options = 0;
+ if( p_item->i_options == 1 )
+ {
+ free( p_item->ppsz_options[0] );
+ p_item->i_options = 0;
+ }
playlist_AddInput( p_playlist, p_item, PLAYLIST_APPEND, PLAYLIST_END,
VLC_FALSE, VLC_FALSE );