]> git.sesse.net Git - vlc/commitdiff
* xpsf.c: ...but <playlist> has... grmbl
authorYoann Peronneau <yoann@videolan.org>
Wed, 14 Jun 2006 02:00:42 +0000 (02:00 +0000)
committerYoann Peronneau <yoann@videolan.org>
Wed, 14 Jun 2006 02:00:42 +0000 (02:00 +0000)
modules/misc/playlist/xspf.c

index 0c20af8e4774f7c4bf0fb98b11454a530d79d5db..325b0bbb91b8558d29d13515348b2b70795248c7 100644 (file)
@@ -44,7 +44,8 @@ int E_(xspf_export_playlist)( vlc_object_t *p_this )
     const playlist_t *p_playlist = (playlist_t *)p_this;
     const playlist_export_t *p_export =
         (playlist_export_t *)p_playlist->p_private;
-    int i, i_count;
+    int               i, i_count;
+    char             *psz_temp;
     playlist_item_t  *p_node = p_export->p_root;
 
     /* write XSPF XML header */
@@ -54,6 +55,22 @@ int E_(xspf_export_playlist)( vlc_object_t *p_this )
 
     if( !p_node ) return VLC_SUCCESS;
 
+    /* save name of the playlist node */
+    psz_temp = convert_xml_special_chars( p_node->p_input->psz_name );
+    if( *psz_temp )
+    {
+        fprintf(  p_export->p_file, "\t<title>%s</title>\n", psz_temp );
+    }
+    free( psz_temp );
+
+    /* save location of the playlist node */
+    psz_temp = assertUTF8URI( p_export->psz_filename );
+    if( psz_temp && *psz_temp )
+    {
+        fprintf( p_export->p_file, "\t<location>%s</location>\n", psz_temp );
+        free( psz_temp );
+    }
+
     /* export all items in a flat format */
     fprintf( p_export->p_file, "\t<trackList>\n" );
     i_count = 0;