]> git.sesse.net Git - vlc/blobdiff - modules/demux/playlist/podcast.c
Removes trailing spaces. Removes tabs.
[vlc] / modules / demux / playlist / podcast.c
index 6d6090d8fc996eb66ca795c945711907cf782e09..60389dae9235531e1ba816d9c783a49b632b518b 100644 (file)
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
-#include <ctype.h>                                              /* isspace() */
-
 #include <vlc/vlc.h>
-#include <vlc/input.h>
-#include <vlc/intf.h>
+#include <vlc_demux.h>
 
 #include "playlist.h"
 #include "vlc_xml.h"
@@ -54,9 +51,9 @@ int E_(Import_podcast)( vlc_object_t *p_this )
 {
     demux_t *p_demux = (demux_t *)p_this;
 
-    if( !isDemux( p_demux, "podcast" ) )
+    if( !demux2_IsForced( p_demux, "podcast" ) )
         return VLC_EGENERIC;
-    
+
     STANDARD_DEMUX_INIT_MSG( "using podcast reader" );
     p_demux->p_sys->psz_prefix = E_(FindPrefix)( p_demux );
     p_demux->p_sys->p_playlist = NULL;
@@ -105,6 +102,7 @@ static int Demux( demux_t *p_demux )
     char *psz_item_subtitle = NULL;
     char *psz_item_summary = NULL;
     int i_type;
+    input_item_t *p_input;
 
     INIT_PLAYLIST_STUFF;
 
@@ -221,7 +219,7 @@ static int Demux( demux_t *p_demux )
                     psz_item_summary = strdup( psz_text );
                 }
                 SET_DATA( psz_item_date, "pubDate" )
-                SET_DATA( psz_item_category, "itunes:category" ) 
+                SET_DATA( psz_item_category, "itunes:category" )
                 SET_DATA( psz_item_duration, "itunes:duration" )
                 SET_DATA( psz_item_keywords, "itunes:keywords" )
                 SET_DATA( psz_item_subtitle, "itunes:subtitle" )
@@ -229,12 +227,12 @@ static int Demux( demux_t *p_demux )
                 else if( b_item == VLC_FALSE && b_image == VLC_FALSE
                          && !strcmp( psz_elname, "title" ) )
                 {
-                    playlist_ItemSetName( p_current, psz_text );
+                    input_item_SetName( p_current_input, psz_text );
                 }
 #define ADD_GINFO( info, name ) \
     else if( !b_item && !b_image && !strcmp( psz_elname, name ) ) \
     { \
-        vlc_input_item_AddInfo( p_current->p_input, _("Podcast Info"), \
+        input_ItemAddInfo( p_current_input, _("Podcast Info"), \
                                 _( info ), "%s", psz_text ); \
     }
                 ADD_GINFO( "Podcast Link", "link" )
@@ -247,7 +245,7 @@ static int Demux( demux_t *p_demux )
                          && ( !strcmp( psz_elname, "itunes:summary" )
                             ||!strcmp( psz_elname, "description" ) ) )
                 { /* <description> isn't standard iTunes podcast stuff */
-                    vlc_input_item_AddInfo( p_current->p_input,
+                    input_ItemAddInfo( p_current_input,
                              _( "Podcast Info" ), _( "Podcast Summary" ),
                              "%s", psz_text );
                 }
@@ -272,7 +270,7 @@ static int Demux( demux_t *p_demux )
                                                 psz_item_name, 0, NULL, -1 );
                     if( p_input == NULL ) break;
 #define ADD_INFO( info, field ) \
-    if( field ) { vlc_input_item_AddInfo( p_input, \
+    if( field ) { input_ItemAddInfo( p_input, \
                             _( "Podcast Info" ),  _( info ), "%s", field ); }
                     ADD_INFO( "Podcast Publication Date", psz_item_date  );
                     ADD_INFO( "Podcast Author", psz_item_author );
@@ -284,15 +282,13 @@ static int Demux( demux_t *p_demux )
                     ADD_INFO( "Podcast Type", psz_item_type );
                     if( psz_item_size )
                     {
-                        vlc_input_item_AddInfo( p_input,
+                        input_ItemAddInfo( p_input,
                                                 _( "Podcast Info" ),
                                                 _( "Podcast Size" ),
                                                 "%s bytes",
                                                 psz_item_size );
                     }
-                    playlist_AddWhereverNeeded( p_playlist, p_input, p_current,
-                          p_item_in_category, (i_parent_id > 0 ) ? VLC_TRUE:
-                                                VLC_FALSE, PLAYLIST_APPEND );
+                    input_ItemAddSubItem( p_current_input, p_input );
                     FREENULL( psz_item_name );
                     FREENULL( psz_item_mrl );
                     FREENULL( psz_item_size );
@@ -324,7 +320,7 @@ static int Demux( demux_t *p_demux )
     }
 
     HANDLE_PLAY_AND_RELEASE;
-    return VLC_SUCCESS;
+    return -1; /* Needed for correct operation of go back */
 }
 
 static int Control( demux_t *p_demux, int i_query, va_list args )