Commit 14cbf5d1 authored by Reka Inovan's avatar Reka Inovan Committed by 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).
parent 4c0b7973
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include <vlc_common.h> #include <vlc_common.h>
#include <vlc_demux.h> #include <vlc_demux.h>
#include <vlc_xml.h> #include <vlc_xml.h>
#include <vlc_strings.h>
#include "playlist.h" #include "playlist.h"
...@@ -190,6 +191,7 @@ static int Demux( demux_t *p_demux ) ...@@ -190,6 +191,7 @@ static int Demux( demux_t *p_demux )
// Read the element name // Read the element name
if( !strcmp( node, "entry" ) ) if( !strcmp( node, "entry" ) )
{ {
resolve_xml_special_chars( psz_mrl );
p_input = input_item_New( psz_mrl, psz_title ); p_input = input_item_New( psz_mrl, psz_title );
if( psz_now ) if( psz_now )
input_item_SetNowPlaying( p_input, psz_now ); input_item_SetNowPlaying( p_input, psz_now );
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include "playlist.h" #include "playlist.h"
#include <vlc_xml.h> #include <vlc_xml.h>
#include <vlc_strings.h>
/***************************************************************************** /*****************************************************************************
* Local prototypes * Local prototypes
...@@ -250,6 +251,8 @@ static int Demux( demux_t *p_demux ) ...@@ -250,6 +251,8 @@ static int Demux( demux_t *p_demux )
continue; 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 ); p_input = input_item_New( psz_item_mrl, psz_item_name );
FREENULL( psz_item_mrl ); FREENULL( psz_item_mrl );
FREENULL( psz_item_name ); FREENULL( psz_item_name );
...@@ -278,7 +281,10 @@ static int Demux( demux_t *p_demux ) ...@@ -278,7 +281,10 @@ static int Demux( demux_t *p_demux )
/* Add the global art url to this item, if any */ /* Add the global art url to this item, if any */
if( psz_art_url ) if( psz_art_url )
{
resolve_xml_special_chars( psz_art_url );
input_item_SetArtURL( p_input, psz_art_url ); input_item_SetArtURL( p_input, psz_art_url );
}
if( psz_item_size ) if( psz_item_size )
{ {
......
...@@ -57,6 +57,7 @@ volume - 0 (mute) - 100 (max) ...@@ -57,6 +57,7 @@ volume - 0 (mute) - 100 (max)
#include "playlist.h" #include "playlist.h"
#include <vlc_xml.h> #include <vlc_xml.h>
#include <vlc_strings.h>
typedef enum { FULLSCREEN_NORMAL, typedef enum { FULLSCREEN_NORMAL,
FULLSCREEN_DOUBLE, FULLSCREEN_DOUBLE,
...@@ -243,6 +244,7 @@ static int Demux( demux_t *p_demux ) ...@@ -243,6 +244,7 @@ static int Demux( demux_t *p_demux )
vlc_gc_decref( p_input ); vlc_gc_decref( p_input );
if( psz_qtnext ) if( psz_qtnext )
{ {
resolve_xml_special_chars( psz_qtnext );
p_input = input_item_New( psz_qtnext, NULL ); p_input = input_item_New( psz_qtnext, NULL );
input_item_node_AppendItem( p_subitems, p_input ); input_item_node_AppendItem( p_subitems, p_input );
vlc_gc_decref( p_input ); vlc_gc_decref( p_input );
......
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
#include "playlist.h" #include "playlist.h"
#include <vlc_xml.h> #include <vlc_xml.h>
#include <vlc_strings.h>
/* duplicate from modules/services_discovery/shout.c */ /* duplicate from modules/services_discovery/shout.c */
#define SHOUTCAST_BASE_URL "http/shout-winamp://www.shoutcast.com/sbin/newxml.phtml" #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, ...@@ -169,6 +170,7 @@ static int DemuxGenre( demux_t *p_demux, xml_reader_t *p_xml_reader,
psz_name ) != -1 ) psz_name ) != -1 )
{ {
input_item_t *p_input; input_item_t *p_input;
resolve_xml_special_chars( psz_mrl );
p_input = input_item_New( psz_mrl, psz_name ); p_input = input_item_New( psz_mrl, psz_name );
input_item_CopyOptions( p_input_node->p_item, p_input ); input_item_CopyOptions( p_input_node->p_item, p_input );
free( psz_mrl ); free( psz_mrl );
...@@ -313,6 +315,7 @@ static int DemuxStation( demux_t *p_demux, xml_reader_t *p_xml_reader, ...@@ -313,6 +315,7 @@ static int DemuxStation( demux_t *p_demux, xml_reader_t *p_xml_reader,
/* Create the item */ /* Create the item */
input_item_t *p_input; input_item_t *p_input;
resolve_xml_special_chars( psz_mrl );
p_input = input_item_New( psz_mrl, psz_name ); p_input = input_item_New( psz_mrl, psz_name );
input_item_CopyOptions( p_input_node->p_item, p_input ); input_item_CopyOptions( p_input_node->p_item, p_input );
free( psz_mrl ); free( psz_mrl );
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include <vlc_common.h> #include <vlc_common.h>
#include <vlc_demux.h> #include <vlc_demux.h>
#include <vlc_strings.h>
#include "playlist.h" #include "playlist.h"
...@@ -97,6 +98,7 @@ static int Demux( demux_t *p_demux ) ...@@ -97,6 +98,7 @@ static int Demux( demux_t *p_demux )
input_item_t *p_input; input_item_t *p_input;
*psz_parse = '\0'; *psz_parse = '\0';
resolve_xml_special_chars( psz_uri );
psz_uri = ProcessMRL( psz_uri, p_demux->p_sys->psz_prefix ); psz_uri = ProcessMRL( psz_uri, p_demux->p_sys->psz_prefix );
p_input = input_item_NewExt( psz_uri, psz_uri, p_input = input_item_NewExt( psz_uri, psz_uri,
0, NULL, 0, -1 ); 0, NULL, 0, -1 );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment