char *psz_eltname = NULL;
int i_ret = -1;
input_item_t *p_current_input = GetCurrentItem(p_demux);
+ input_item_node_t *p_input_node = NULL;
p_xml = xml_Create( p_demux );
if( !p_xml )
goto error;
}
- input_item_node_t *p_input_node = input_item_node_Create( p_current_input );
+ p_input_node = input_item_node_Create( p_current_input );
if( !strcmp( psz_eltname, "genrelist" ) )
{
{
/* we're reading a station list */
if( DemuxStation( p_demux, p_xml_reader, p_input_node,
- var_CreateGetBool( p_demux, "shoutcast-show-adult" ) ) )
+ var_InheritBool( p_demux, "shoutcast-show-adult" ) ) )
goto error;
}
- input_item_AddSubItemTree( p_input_node );
+ input_item_node_PostAndDelete( p_input_node );
+ p_input_node = NULL;
i_ret = 0; /* Needed for correct operation of go back */
error:
if( p_xml_reader )
- xml_ReaderDelete( p_xml, p_xml_reader );
+ xml_ReaderDelete( p_xml_reader );
if( p_xml )
xml_Delete( p_xml );
free( psz_eltname );
- input_item_node_Delete( p_input_node );
+ if( p_input_node ) input_item_node_Delete( p_input_node );
vlc_gc_decref(p_current_input);
return i_ret;
}
else
{
msg_Warn( p_demux,
- "unexpected attribure %s in element %s",
+ "unexpected attribute %s in element %s",
psz_attrname, psz_eltname );
free( psz_attrvalue );
}
p_input = input_item_New( p_demux, psz_mrl, psz_name );
input_item_CopyOptions( p_input_node->p_item, p_input );
free( psz_mrl );
- input_item_AddSubItem( p_input_node->p_item, p_input );
input_item_node_AppendItem( p_input_node, p_input );
vlc_gc_decref( p_input );
}
else
{
msg_Warn( p_demux,
- "unexpected attribure %s in element %s",
+ "unexpected attribute %s in element %s",
psz_attrname, psz_eltname );
free( psz_attrvalue );
}
input_item_SetNowPlaying( p_input, psz_ct );
if( psz_rt )
input_item_SetRating( p_input, psz_rt );
- input_item_AddSubItem( p_input_node->p_item, p_input );
input_item_node_AppendItem( p_input_node, p_input );
vlc_gc_decref( p_input );
FREENULL( psz_base );