]> git.sesse.net Git - vlc/commitdiff
Add entity encoding for input options when outputting an xml file.
authorDaniel Tisza <dadatis@gmail.com>
Sun, 11 Jul 2010 08:52:23 +0000 (11:52 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Sun, 11 Jul 2010 09:16:22 +0000 (12:16 +0300)
Entity encoding was missing (for options) in generation of an xspf playlist.
On the reading side the entity decoding is all fine.

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
modules/misc/playlist/xspf.c

index 3db0e98442f149b52a92116921fff0bbcf7760d2..4f09caf96904c46e0fd347683ca4d1afa9befd16 100644 (file)
@@ -208,10 +208,18 @@ xspfexportitem_end:
 
     for( int i = 0; i < p_item->p_input->i_options; i++ )
     {
-        fprintf( p_file, "\t\t\t\t<vlc:option>%s</vlc:option>\n",
-                 p_item->p_input->ppsz_options[i][0] == ':' ?
-                 p_item->p_input->ppsz_options[i] + 1 :
-                 p_item->p_input->ppsz_options[i] );
+        char* psz_src = p_item->p_input->ppsz_options[i];
+        char* psz_ret = NULL;
+
+        if ( psz_src[0] == ':' )
+            psz_src++;
+
+        psz_ret = convert_xml_special_chars( psz_src );
+        if ( psz_ret == NULL )
+            continue;
+
+        fprintf( p_file, "\t\t\t\t<vlc:option>%s</vlc:option>\n", psz_ret );
+        free( psz_ret );
     }
     fputs( "\t\t\t</extension>\n", p_file );
     fputs( "\t\t</track>\n", p_file );