Commit 33ec1713 authored by Rafaël Carré's avatar Rafaël Carré

Assume input_item_t->psz_uri contains an URI

, like the name indicates.
Pass unmodified URIs from xspf to vlc, and stores them in xspf
unmodified as well

This commit partly reverts [9a746cfa]
Code using psz_uri should be checked for consistency, and GUIs might want to decode components at display
parent c4dcc7a5
......@@ -546,23 +546,11 @@ static bool parse_track_node COMPLEX_INTERFACE
/* special case: location */
if( !strcmp( p_handler->name, "location" ) )
{
char *psz_location = psz_value;
if( !strncmp( psz_value, "file://", 7 ) ) /* file path */
psz_location = decode_URI( psz_value + 7 );
else if( !strstr( psz_value, "://" ) ) /* relative path */
psz_location = decode_URI( psz_value );
if( !psz_location )
{
FREE_ATT();
return false;
}
if( p_demux->p_sys->psz_base && !strstr( psz_value, "://" ) )
{
char* psz_tmp;
if( asprintf( &psz_tmp, "%s%s", p_demux->p_sys->psz_base,
psz_location ) == -1 )
if( asprintf( &psz_tmp, "%s%s",
p_demux->p_sys->psz_base, psz_value ) == -1 )
{
FREE_ATT();
return NULL;
......@@ -571,7 +559,7 @@ static bool parse_track_node COMPLEX_INTERFACE
free( psz_tmp );
}
else
input_item_SetURI( p_new_input, psz_location );
input_item_SetURI( p_new_input, psz_value );
input_item_CopyOptions( p_input_item, p_new_input );
FREE_ATT();
p_handler = NULL;
......
......@@ -141,11 +141,7 @@ static void xspf_export_item( playlist_item_t *p_item, FILE *p_file,
char *psz_uri = input_item_GetURI( p_item->p_input );
if( psz_uri && *psz_uri )
{
psz = make_URI( psz_uri );
fprintf( p_file, "\t\t\t<location>%s</location>\n", psz );
free( psz );
}
fprintf( p_file, "\t\t\t<location>%s</location>\n", psz_uri );
/* -> the name/title (only if different from uri)*/
char *psz_name = input_item_GetTitle( p_item->p_input );
......
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