Commit 1d451bbb authored by Rémi Duraffort's avatar Rémi Duraffort

xspf: cosmetics.

parent f3c14e26
...@@ -382,10 +382,10 @@ static bool parse_tracklist_node COMPLEX_INTERFACE ...@@ -382,10 +382,10 @@ static bool parse_tracklist_node COMPLEX_INTERFACE
*/ */
static bool parse_track_node COMPLEX_INTERFACE static bool parse_track_node COMPLEX_INTERFACE
{ {
int i_node;
char *psz_name = NULL; char *psz_name = NULL;
char *psz_value = NULL; char *psz_value = NULL;
xml_elem_hnd_t *p_handler = NULL; xml_elem_hnd_t *p_handler = NULL;
demux_sys_t *p_sys = p_demux->p_sys;
xml_elem_hnd_t track_elements[] = xml_elem_hnd_t track_elements[] =
{ {"location", SIMPLE_CONTENT, {NULL} }, { {"location", SIMPLE_CONTENT, {NULL} },
...@@ -413,11 +413,11 @@ static bool parse_track_node COMPLEX_INTERFACE ...@@ -413,11 +413,11 @@ static bool parse_track_node COMPLEX_INTERFACE
} }
/* reset i_track_id */ /* reset i_track_id */
p_demux->p_sys->i_track_id = -1; p_sys->i_track_id = -1;
while( xml_ReaderRead( p_xml_reader ) == 1 ) while( xml_ReaderRead( p_xml_reader ) == 1 )
{ {
i_node = xml_ReaderNodeType( p_xml_reader ); int i_node = xml_ReaderNodeType( p_xml_reader );
switch( i_node ) switch( i_node )
{ {
case XML_READER_NONE: case XML_READER_NONE:
...@@ -497,29 +497,26 @@ static bool parse_track_node COMPLEX_INTERFACE ...@@ -497,29 +497,26 @@ static bool parse_track_node COMPLEX_INTERFACE
} }
free( psz_uri ); free( psz_uri );
if( p_demux->p_sys->i_track_id < 0 ) if( p_sys->i_track_id < 0 )
{ {
input_item_AddSubItem( p_input_item, p_new_input ); input_item_AddSubItem( p_input_item, p_new_input );
vlc_gc_decref( p_new_input ); vlc_gc_decref( p_new_input );
return true; return true;
} }
if( p_demux->p_sys->i_track_id >= if( p_sys->i_track_id >= p_sys->i_tracklist_entries )
p_demux->p_sys->i_tracklist_entries )
{ {
input_item_t **pp; input_item_t **pp;
pp = realloc( p_demux->p_sys->pp_tracklist, pp = realloc( p_sys->pp_tracklist,
(p_demux->p_sys->i_track_id + 1) * sizeof(*pp) ); (p_sys->i_track_id + 1) * sizeof(*pp) );
if( !pp ) if( !pp )
return false; return false;
p_demux->p_sys->pp_tracklist = pp; p_sys->pp_tracklist = pp;
while( p_demux->p_sys->i_track_id >= while( p_sys->i_track_id >= p_sys->i_tracklist_entries )
p_demux->p_sys->i_tracklist_entries ) pp[p_sys->i_tracklist_entries++] = NULL;
pp[p_demux->p_sys->i_tracklist_entries++] = NULL;
} }
p_demux->p_sys->pp_tracklist[ p_sys->pp_tracklist[ p_sys->i_track_id ] = p_new_input;
p_demux->p_sys->i_track_id ] = p_new_input;
return true; return true;
} }
/* there MUST have been a start tag for that element name */ /* there MUST have been a start tag for that element name */
...@@ -542,11 +539,11 @@ static bool parse_track_node COMPLEX_INTERFACE ...@@ -542,11 +539,11 @@ static bool parse_track_node COMPLEX_INTERFACE
* Last, psz_base should default to the XSPF resource * Last, psz_base should default to the XSPF resource
* location if missing (not the current working directory). * location if missing (not the current working directory).
* -- Courmisch */ * -- Courmisch */
if( p_demux->p_sys->psz_base && !strstr( psz_value, "://" ) ) if( p_sys->psz_base && !strstr( psz_value, "://" ) )
{ {
char* psz_tmp; char* psz_tmp;
if( asprintf( &psz_tmp, "%s%s", if( asprintf( &psz_tmp, "%s%s", p_sys->psz_base,
p_demux->p_sys->psz_base, psz_value ) == -1 ) psz_value ) == -1 )
{ {
FREE_ATT(); FREE_ATT();
return NULL; return NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment