Assume input_item_t->psz_uri contains an URI
authorRafaël Carré <rafael.carre@gmail.com>
Tue, 23 Jun 2009 19:27:42 +0000 (21:27 +0200)
committerRafaël Carré <rafael.carre@gmail.com>
Tue, 23 Jun 2009 19:32:20 +0000 (21:32 +0200)
, like the name indicates.
Pass unmodified URIs from xspf to vlc, and stores them in xspf
unmodified as well

This commit partly reverts [9a746cfa3078c53eed57d2102002b39c283c6ab4]
Code using psz_uri should be checked for consistency, and GUIs might want to decode components at display

modules/demux/playlist/xspf.c
modules/misc/playlist/xspf.c

index a5e3679..48ad5dd 100644 (file)
@@ -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;
index 6765adb..76b95bc 100644 (file)
@@ -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 );