[vlc-commits] Resolving XML special chars on xml based format

Reka Inovan git at videolan.org
Sat Oct 12 23:44:54 CEST 2013


vlc | branch: master | Reka Inovan <reka.inovan at gmail.com> | Sun Sep 29 17:21:49 2013 +0700| [14cbf5d174990956d3c83a620f55a156abab3cd0] | committer: Jean-Baptiste Kempf

Resolving XML special chars on xml based format

It fixes bug #9311 and resolves xml special chars on several other xml based playlist format (b4s, podcast, shoutcast, qtl).

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

 modules/demux/playlist/b4s.c       |    2 ++
 modules/demux/playlist/podcast.c   |    6 ++++++
 modules/demux/playlist/qtl.c       |    2 ++
 modules/demux/playlist/shoutcast.c |    3 +++
 modules/demux/playlist/wpl.c       |    2 ++
 5 files changed, 15 insertions(+)

diff --git a/modules/demux/playlist/b4s.c b/modules/demux/playlist/b4s.c
index 7009195..d9c0465 100644
--- a/modules/demux/playlist/b4s.c
+++ b/modules/demux/playlist/b4s.c
@@ -32,6 +32,7 @@
 #include <vlc_common.h>
 #include <vlc_demux.h>
 #include <vlc_xml.h>
+#include <vlc_strings.h>
 
 #include "playlist.h"
 
@@ -190,6 +191,7 @@ static int Demux( demux_t *p_demux )
                 // Read the element name
                 if( !strcmp( node, "entry" ) )
                 {
+                    resolve_xml_special_chars( psz_mrl );
                     p_input = input_item_New( psz_mrl, psz_title );
                     if( psz_now )
                         input_item_SetNowPlaying( p_input, psz_now );
diff --git a/modules/demux/playlist/podcast.c b/modules/demux/playlist/podcast.c
index 6af712b..b0c44d9 100644
--- a/modules/demux/playlist/podcast.c
+++ b/modules/demux/playlist/podcast.c
@@ -33,6 +33,7 @@
 
 #include "playlist.h"
 #include <vlc_xml.h>
+#include <vlc_strings.h>
 
 /*****************************************************************************
  * Local prototypes
@@ -250,6 +251,8 @@ static int Demux( demux_t *p_demux )
                         continue;
                     }
 
+                    resolve_xml_special_chars( psz_item_mrl );
+                    resolve_xml_special_chars( psz_item_name );
                     p_input = input_item_New( psz_item_mrl, psz_item_name );
                     FREENULL( psz_item_mrl );
                     FREENULL( psz_item_name );
@@ -278,7 +281,10 @@ static int Demux( demux_t *p_demux )
 
                     /* Add the global art url to this item, if any */
                     if( psz_art_url )
+                    {
+                        resolve_xml_special_chars( psz_art_url );
                         input_item_SetArtURL( p_input, psz_art_url );
+                    }
 
                     if( psz_item_size )
                     {
diff --git a/modules/demux/playlist/qtl.c b/modules/demux/playlist/qtl.c
index f3514d2..958b29e 100644
--- a/modules/demux/playlist/qtl.c
+++ b/modules/demux/playlist/qtl.c
@@ -57,6 +57,7 @@ volume - 0 (mute) - 100 (max)
 
 #include "playlist.h"
 #include <vlc_xml.h>
+#include <vlc_strings.h>
 
 typedef enum { FULLSCREEN_NORMAL,
                FULLSCREEN_DOUBLE,
@@ -243,6 +244,7 @@ static int Demux( demux_t *p_demux )
         vlc_gc_decref( p_input );
         if( psz_qtnext )
         {
+            resolve_xml_special_chars( psz_qtnext );
             p_input = input_item_New( psz_qtnext, NULL );
             input_item_node_AppendItem( p_subitems, p_input );
             vlc_gc_decref( p_input );
diff --git a/modules/demux/playlist/shoutcast.c b/modules/demux/playlist/shoutcast.c
index 9348819..a7d7afc 100644
--- a/modules/demux/playlist/shoutcast.c
+++ b/modules/demux/playlist/shoutcast.c
@@ -35,6 +35,7 @@
 
 #include "playlist.h"
 #include <vlc_xml.h>
+#include <vlc_strings.h>
 
 /* duplicate from modules/services_discovery/shout.c */
 #define SHOUTCAST_BASE_URL "http/shout-winamp://www.shoutcast.com/sbin/newxml.phtml"
@@ -169,6 +170,7 @@ static int DemuxGenre( demux_t *p_demux, xml_reader_t *p_xml_reader,
                                   psz_name ) != -1 )
                     {
                         input_item_t *p_input;
+                        resolve_xml_special_chars( psz_mrl );
                         p_input = input_item_New( psz_mrl, psz_name );
                         input_item_CopyOptions( p_input_node->p_item, p_input );
                         free( psz_mrl );
@@ -313,6 +315,7 @@ static int DemuxStation( demux_t *p_demux, xml_reader_t *p_xml_reader,
 
                     /* Create the item */
                     input_item_t *p_input;
+                    resolve_xml_special_chars( psz_mrl );
                     p_input = input_item_New( psz_mrl, psz_name );
                     input_item_CopyOptions( p_input_node->p_item, p_input );
                     free( psz_mrl );
diff --git a/modules/demux/playlist/wpl.c b/modules/demux/playlist/wpl.c
index a838545..365488b 100644
--- a/modules/demux/playlist/wpl.c
+++ b/modules/demux/playlist/wpl.c
@@ -30,6 +30,7 @@
 
 #include <vlc_common.h>
 #include <vlc_demux.h>
+#include <vlc_strings.h>
 
 #include "playlist.h"
 
@@ -97,6 +98,7 @@ static int Demux( demux_t *p_demux )
                 input_item_t *p_input;
 
                 *psz_parse = '\0';
+                resolve_xml_special_chars( psz_uri );
                 psz_uri = ProcessMRL( psz_uri, p_demux->p_sys->psz_prefix );
                 p_input = input_item_NewExt( psz_uri, psz_uri,
                                         0, NULL, 0, -1 );



More information about the vlc-commits mailing list