]> git.sesse.net Git - vlc/blobdiff - modules/demux/playlist/b4s.c
Removes trailing spaces. Removes tabs.
[vlc] / modules / demux / playlist / b4s.c
index 591f5ad70bbcea70bd42939b85748359e46a5ae6..f9d6c9ffc0522556bc5d6a8b9a3562ce796967cf 100644 (file)
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
-#include <ctype.h>                                              /* isspace() */
 
 #include <vlc/vlc.h>
-#include <vlc/input.h>
-#include <vlc/intf.h>
+#include <vlc_demux.h>
+#include <vlc_interface.h>
 
 #include "playlist.h"
 #include "vlc_xml.h"
@@ -45,7 +44,7 @@ struct demux_sys_t
  *****************************************************************************/
 static int Demux( demux_t *p_demux);
 static int Control( demux_t *p_demux, int i_query, va_list args );
-static char *GetNextToken(char *psz_cur_string);
+//static char *GetNextToken(char *psz_cur_string);
 static int IsWhitespace( char *psz_string );
 
 /*****************************************************************************
@@ -53,7 +52,7 @@ static int IsWhitespace( char *psz_string );
  *****************************************************************************/
 int E_(Import_B4S)( vlc_object_t *p_this )
 {
-    DEMUX_BY_EXTENSION_OR_FORCED_MSG( ".b4s", "b4s-open", 
+    DEMUX_BY_EXTENSION_OR_FORCED_MSG( ".b4s", "b4s-open",
                                       "using B4S playlist reader" );
     p_demux->p_sys->psz_prefix = E_(FindPrefix)( p_demux );
     p_demux->p_sys->p_xml = NULL;
@@ -84,6 +83,7 @@ static int Demux( demux_t *p_demux )
     xml_reader_t *p_xml_reader;
     char *psz_elname = NULL;
     int i_type;
+    input_item_t *p_input;
     char *psz_mrl = NULL, *psz_name = NULL, *psz_genre = NULL;
     char *psz_now = NULL, *psz_listeners = NULL, *psz_bitrate = NULL;
 
@@ -154,7 +154,7 @@ static int Demux( demux_t *p_demux )
         }
         else if( !strcmp( psz_name, "label" ) )
         {
-            playlist_ItemSetName( p_current, psz_value );
+            input_item_SetName( p_current_input, psz_value );
         }
         else
         {
@@ -257,18 +257,15 @@ static int Demux( demux_t *p_demux )
                     p_input = input_ItemNewExt( p_playlist, psz_mrl, psz_name,
                                                 0, NULL, -1 );
                     if( psz_now )
-                        vlc_meta_SetNowPlaying( p_input->p_meta, psz_now );
+                        input_item_SetNowPlaying( p_input, psz_now );
                     if( psz_genre )
-                        vlc_meta_SetGenre( p_input->p_meta, psz_genre );
+                        input_item_SetGenre( p_input, psz_genre );
                     if( psz_listeners )
                         msg_Err( p_playlist, "Unsupported meta listeners" );
                     if( psz_bitrate )
                         msg_Err( p_playlist, "Unsupported meta bitrate" );
 
-                    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_name );
                     FREENULL( psz_mrl );
                     FREENULL( psz_genre );
@@ -290,7 +287,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 )
@@ -298,6 +295,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
     return VLC_EGENERIC;
 }
 
+#if 0
 /**
  * Get a in-string pointer to the start of the next token from a
  * string terminating the pointer returned by a previous call.
@@ -318,6 +316,7 @@ static char *GetNextToken(char *psz_cur_string) {
         psz_cur_string++;
     return psz_cur_string;
 }
+#endif
 
 static int IsWhitespace( char *psz_string )
 {