[vlc-devel] commit: Assume input_item_t->psz_uri contains an URI ( Rafaël Carré )

git version control git at videolan.org
Tue Jun 23 21:32:57 CEST 2009


vlc | branch: master | Rafaël Carré <rafael.carre at gmail.com> | Tue Jun 23 21:27:42 2009 +0200| [33ec1713358d3dd48249003cd2c29eff23683a31] | committer: 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 [9a746cfa3078c53eed57d2102002b39c283c6ab4]
Code using psz_uri should be checked for consistency, and GUIs might want to decode components at display

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=33ec1713358d3dd48249003cd2c29eff23683a31
---

 modules/demux/playlist/xspf.c |   18 +++---------------
 modules/misc/playlist/xspf.c  |    6 +-----
 2 files changed, 4 insertions(+), 20 deletions(-)

diff --git a/modules/demux/playlist/xspf.c b/modules/demux/playlist/xspf.c
index a5e3679..48ad5dd 100644
--- a/modules/demux/playlist/xspf.c
+++ b/modules/demux/playlist/xspf.c
@@ -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;
diff --git a/modules/misc/playlist/xspf.c b/modules/misc/playlist/xspf.c
index 6765adb..76b95bc 100644
--- a/modules/misc/playlist/xspf.c
+++ b/modules/misc/playlist/xspf.c
@@ -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 );




More information about the vlc-devel mailing list