/*****************************************************************************
* Preamble
*****************************************************************************/
/*****************************************************************************
* Preamble
*****************************************************************************/
/*****************************************************************************
* Import_podcast: main import function
*****************************************************************************/
/*****************************************************************************
* Import_podcast: main import function
*****************************************************************************/
/*****************************************************************************
* Deactivate: frees unused data
*****************************************************************************/
/*****************************************************************************
* Deactivate: frees unused data
*****************************************************************************/
if( p_sys->p_xml_reader ) xml_ReaderDelete( p_sys->p_xml, p_sys->p_xml_reader );
if( p_sys->p_xml ) xml_Delete( p_sys->p_xml );
free( p_sys );
if( p_sys->p_xml_reader ) xml_ReaderDelete( p_sys->p_xml, p_sys->p_xml_reader );
if( p_sys->p_xml ) xml_Delete( p_sys->p_xml );
free( p_sys );
{
msg_Err( p_demux, "invalid root node %i, %s",
xml_ReaderNodeType( p_xml_reader ), psz_elname );
{
msg_Err( p_demux, "invalid root node %i, %s",
xml_ReaderNodeType( p_xml_reader ), psz_elname );
psz_elname = xml_ReaderName( p_xml_reader );
if( !psz_elname ) return -1;
if( !strcmp( psz_elname, "item" ) )
{
psz_elname = xml_ReaderName( p_xml_reader );
if( !psz_elname ) return -1;
if( !strcmp( psz_elname, "item" ) )
{
if( !strcmp( psz_elname, "enclosure" ) &&
!strcmp( psz_name, "url" ) )
{
if( !strcmp( psz_elname, "enclosure" ) &&
!strcmp( psz_name, "url" ) )
{
&& !strcmp( psz_elname, name ) ) \
{ \
field = strdup( psz_text ); \
}
char *psz_text = xml_ReaderValue( p_xml_reader );
/* item specific meta data */
&& !strcmp( psz_elname, name ) ) \
{ \
field = strdup( psz_text ); \
}
char *psz_text = xml_ReaderValue( p_xml_reader );
/* item specific meta data */
&& ( !strcmp( psz_elname, "itunes:author" )
||!strcmp( psz_elname, "author" ) ) )
{ /* <author> isn't standard iTunes podcast stuff */
psz_item_author = strdup( psz_text );
}
&& ( !strcmp( psz_elname, "itunes:author" )
||!strcmp( psz_elname, "author" ) ) )
{ /* <author> isn't standard iTunes podcast stuff */
psz_item_author = strdup( psz_text );
}
&& ( !strcmp( psz_elname, "itunes:summary" )
||!strcmp( psz_elname, "description" ) ) )
{ /* <description> isn't standard iTunes podcast stuff */
psz_item_summary = strdup( psz_text );
}
SET_DATA( psz_item_date, "pubDate" )
&& ( !strcmp( psz_elname, "itunes:summary" )
||!strcmp( psz_elname, "description" ) ) )
{ /* <description> isn't standard iTunes podcast stuff */
psz_item_summary = strdup( psz_text );
}
SET_DATA( psz_item_date, "pubDate" )
SET_DATA( psz_item_duration, "itunes:duration" )
SET_DATA( psz_item_keywords, "itunes:keywords" )
SET_DATA( psz_item_subtitle, "itunes:subtitle" )
/* toplevel meta data */
SET_DATA( psz_item_duration, "itunes:duration" )
SET_DATA( psz_item_keywords, "itunes:keywords" )
SET_DATA( psz_item_subtitle, "itunes:subtitle" )
/* toplevel meta data */
}
#define ADD_GINFO( info, name ) \
else if( !b_item && !b_image && !strcmp( psz_elname, name ) ) \
{ \
}
#define ADD_GINFO( info, name ) \
else if( !b_item && !b_image && !strcmp( psz_elname, name ) ) \
{ \
_( info ), "%s", psz_text ); \
}
ADD_GINFO( "Podcast Link", "link" )
_( info ), "%s", psz_text ); \
}
ADD_GINFO( "Podcast Link", "link" )
ADD_GINFO( "Podcast Keywords", "itunes:keywords" )
ADD_GINFO( "Podcast Subtitle", "itunes:subtitle" )
#undef ADD_GINFO
ADD_GINFO( "Podcast Keywords", "itunes:keywords" )
ADD_GINFO( "Podcast Subtitle", "itunes:subtitle" )
#undef ADD_GINFO
&& ( !strcmp( psz_elname, "itunes:summary" )
||!strcmp( psz_elname, "description" ) ) )
{ /* <description> isn't standard iTunes podcast stuff */
&& ( !strcmp( psz_elname, "itunes:summary" )
||!strcmp( psz_elname, "description" ) ) )
{ /* <description> isn't standard iTunes podcast stuff */
if( !psz_elname ) return -1;
if( !strcmp( psz_elname, "item" ) )
{
if( !psz_elname ) return -1;
if( !strcmp( psz_elname, "item" ) )
{
- p_input = input_ItemNewExt( p_playlist, psz_item_mrl,
+ if( psz_item_mrl == NULL )
+ {
+ msg_Err( p_demux, "invalid XML (no enclosure markup)" );
+ return -1;
+ }
+ p_input = input_item_NewExt( p_demux, psz_item_mrl,
psz_item_name, 0, NULL, -1 );
if( p_input == NULL ) break;
#define ADD_INFO( info, field ) \
psz_item_name, 0, NULL, -1 );
if( p_input == NULL ) break;
#define ADD_INFO( info, field ) \
_( "Podcast Info" ), _( info ), "%s", field ); }
ADD_INFO( "Podcast Publication Date", psz_item_date );
ADD_INFO( "Podcast Author", psz_item_author );
_( "Podcast Info" ), _( info ), "%s", field ); }
ADD_INFO( "Podcast Publication Date", psz_item_date );
ADD_INFO( "Podcast Author", psz_item_author );
- playlist_BothAddInput( p_playlist, p_input,
- p_item_in_category,
- PLAYLIST_APPEND | PLAYLIST_SPREPARSE
- , PLAYLIST_END, NULL, NULL, VLC_FALSE );
+ input_item_AddSubItem( p_current_input, p_input );
+ vlc_gc_decref( p_input );
FREENULL( psz_item_name );
FREENULL( psz_item_mrl );
FREENULL( psz_item_size );
FREENULL( psz_item_name );
FREENULL( psz_item_mrl );
FREENULL( psz_item_size );
FREENULL( psz_item_keywords );
FREENULL( psz_item_subtitle );
FREENULL( psz_item_summary );
FREENULL( psz_item_keywords );
FREENULL( psz_item_subtitle );
FREENULL( psz_item_summary );