[vlc-devel] The XSPF issue 2875 (the non-windows one)

Derk-Jan Hartman hartman at videolan.org
Mon Jun 22 03:35:33 CEST 2009

This is about: https://trac.videolan.org/vlc/ticket/2875

In the current code (since http://git.videolan.org/?p=vlc.git;a=commitdiff;h=a654d4a14edf1a3925cfa731c965652832f01ef2) 
  we have:
546                 /* special case: location */
547                 if( !strcmp( p_handler->name, "location" ) )
548                 {
549                     char *psz_location = psz_value;
550                     if( !strncmp( psz_value, "file://", 7 ) )
551                         psz_location = decode_URI( psz_value + 7 );

This seems wrong to me, and I'm not really sure what the goal is here.  
To quote the relevant standards:

The location attribute of XSPF:
Source URI for this playlist. xspf:playlist elements MAY contain  
exactly one.

6.2 Relative paths
Relative paths MUST be resolved according to the XML Base  
specification or IETF RFC 2396:

The rules for determining the base URI can be be summarized as follows  
(highest priority to lowest): The base URI is embedded in the  
document's content. The base URI is that of the encapsulating entity  
(message, document, or none). The base URI is the URI used to retrieve  
the entity. The base URI is defined by the context of the application.
Generators should take extra care to ensure that relative paths are  
correctly encoded. Do:
<location>My Song.flac</location>

And to quote Wikipedia:
Examples of URI references
	• http://en.wikipedia.org/wiki/URI#Examples_of_URI_references ("http"  
is the 'scheme' name, "en.wikipedia.org" is the 'authority', "/wiki/ 
URI" the 'path' pointing to this article, and  
"#Examples_of_URI_references" is a 'fragment' pointing to this section.)
	• http://example.org/absolute/URI/with/absolute/path/to/resource.txt
	• /relative/URI/with/absolute/path/to/resource.txt
	• relative/path/to/resource.txt
	• ../../../resource.txt
	• ./resource.txt#frag01
	• resource.txt
	• #frag01
	• (empty string)

So what is the idea here. Are we storing uncoded, or coded paths in  
the VLC input core (I though uncoded), and why should we have  
different behaviour for URIs when we read the playlist? In my  
assessment, it seems we should just psz_location =  
decode_URI( psz_value ); for xspf reading.


More information about the vlc-devel mailing list