[vlc-commits] commit: Add entity encoding for input options when outputting an xml file. (Daniel Tisza )

git at videolan.org git at videolan.org
Sun Jul 11 11:19:40 CEST 2010


vlc/vlc-1.1 | branch: master | Daniel Tisza <dadatis at gmail.com> | Sun Jul 11 11:52:23 2010 +0300| [133d8a9213a8344b6368a0106d408461f8ac1615] | committer: Rémi Denis-Courmont 

Add entity encoding for input options when outputting an xml file.

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 at remlab.net>
(cherry picked from commit 21f056e8c51e0c1f9ad522a41b5cfd48ea088160)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-1.1.git/?a=commit;h=133d8a9213a8344b6368a0106d408461f8ac1615
---

 modules/misc/playlist/xspf.c |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/modules/misc/playlist/xspf.c b/modules/misc/playlist/xspf.c
index 3db0e98..4f09caf 100644
--- a/modules/misc/playlist/xspf.c
+++ b/modules/misc/playlist/xspf.c
@@ -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 );



More information about the vlc-commits mailing list