Commit 1ba7797b authored by Rémi Duraffort's avatar Rémi Duraffort

wpl/zpl: really compile the modules and fixe some issues.

(still some issues that I will fixe later on)
parent c790b667
SOURCES_playlist = \ SOURCES_playlist = \
playlist.c \ asx.c \
playlist.h \
m3u.c \
ram.c \
b4s.c \ b4s.c \
pls.c \
dvb.c \ dvb.c \
podcast.c \
xspf.c \
xspf.h \
shoutcast.c \
asx.c \
sgimb.c \
qtl.c \
gvp.c \ gvp.c \
ifo.c \ ifo.c \
itml.c \ itml.c \
itml.h \ itml.h \
m3u.c \
playlist.c \
playlist.h \
pls.c \
podcast.c \
qtl.c \
ram.c \
sgimb.c \
shoutcast.c \
wpl.c \
xspf.c \
xspf.h \
zpl.c \
$(NULL) $(NULL)
libvlc_LTLIBRARIES += libplaylist_plugin.la libvlc_LTLIBRARIES += libplaylist_plugin.la
...@@ -151,6 +151,18 @@ vlc_module_begin () ...@@ -151,6 +151,18 @@ vlc_module_begin ()
add_shortcut( "itml" ) add_shortcut( "itml" )
set_capability( "demux", 10 ) set_capability( "demux", 10 )
set_callbacks( Import_iTML, Close_iTML ) set_callbacks( Import_iTML, Close_iTML )
add_submodule ()
set_description( N_("WPL playlist") )
add_shortcut( "playlist" )
add_shortcut( "wpl" )
set_capability( "demux", 10 )
set_callbacks( Import_WPL, Close_WPL )
add_submodule ()
set_description( N_("ZPL playlist") )
add_shortcut( "playlist" )
add_shortcut( "zpl" )
set_capability( "demux", 10 )
set_callbacks( Import_ZPL, Close_ZPL )
vlc_module_end () vlc_module_end ()
......
...@@ -76,6 +76,12 @@ void Close_VideoPortal ( vlc_object_t * ); ...@@ -76,6 +76,12 @@ void Close_VideoPortal ( vlc_object_t * );
int Import_iTML ( vlc_object_t * ); int Import_iTML ( vlc_object_t * );
void Close_iTML ( vlc_object_t * ); void Close_iTML ( vlc_object_t * );
int Import_WPL ( vlc_object_t * );
void Close_WPL ( vlc_object_t * );
int Import_ZPL ( vlc_object_t * );
void Close_ZPL ( vlc_object_t * );
#define INIT_PLAYLIST_STUFF \ #define INIT_PLAYLIST_STUFF \
input_thread_t *p_input_thread = (input_thread_t *)vlc_object_find( p_demux, VLC_OBJECT_INPUT, FIND_PARENT ); \ input_thread_t *p_input_thread = (input_thread_t *)vlc_object_find( p_demux, VLC_OBJECT_INPUT, FIND_PARENT ); \
input_item_t *p_current_input = input_GetItem( p_input_thread ); input_item_t *p_current_input = input_GetItem( p_input_thread );
......
...@@ -101,31 +101,28 @@ static int Demux( demux_t *p_demux ) ...@@ -101,31 +101,28 @@ static int Demux( demux_t *p_demux )
while( psz_line ) while( psz_line )
{ {
psz_parse = psz_line; psz_parse = psz_line;
/* Skip leading tabs and spaces */ /* Skip leading tabs and spaces */
while( *psz_parse == ' ' || *psz_parse == '\t' || while( *psz_parse == ' ' || *psz_parse == '\t' ||
*psz_parse == '\n' || *psz_parse == '\r' ) psz_parse++; *psz_parse == '\n' || *psz_parse == '\r' )
psz_parse++;
if( !strncasecmp( psz_parse, "<media src=\"", sizeof( "<media src=\"" ) - 1 ) )/*if the line is uri of media item*/ /* if the line is the uri of the media item */
if( !strncasecmp( psz_parse, "<media src=\"", strlen( "<media src=\"" ) ) )
{ {
psz_uri = ParseUriValue( psz_parse ); psz_uri = ParseUriValue( psz_parse );
if( psz_uri && *psz_uri ) if( !EMPTY_STR(psz_uri) )
{ {
psz_uri = ProcessMRL( psz_uri, p_demux->p_sys->psz_prefix ); psz_uri = ProcessMRL( psz_uri, p_demux->p_sys->psz_prefix );
MaybeFromLocaleRep( &psz_uri ); MaybeFromLocaleRep( &psz_uri );
p_input = input_item_NewExt( p_demux, psz_uri, psz_uri, p_input = input_item_NewExt( p_demux, psz_uri, psz_uri,
0, NULL, 0, -1 ); 0, NULL, 0, -1 );
input_item_AddSubItem( p_current_input, p_input ); input_item_AddSubItem( p_current_input, p_input );
p_input = NULL;
free( psz_uri );
} }
free( psz_uri );
} }
free( psz_line );
psz_line = NULL;
/* Fetch another line */ /* Fetch another line */
free( psz_line );
psz_line = stream_ReadLine( p_demux->s ); psz_line = stream_ReadLine( p_demux->s );
} }
...@@ -140,21 +137,18 @@ static int Control( demux_t *p_demux, int i_query, va_list args ) ...@@ -140,21 +137,18 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
return VLC_EGENERIC; return VLC_EGENERIC;
} }
static char* ParseUriValue(char* psz_string) static char* ParseUriValue( char* psz_string )
{ {
int i_len = strlen( psz_string ); int i_len = strlen( psz_string );
if(i_len <= 3 ) if( i_len <= 3 )
return NULL; return NULL;
char* psz_value = (char *)malloc( i_len ); char* psz_value = calloc( i_len, 1 );
if( ! psz_value ) if( !psz_value )
return NULL; return NULL;
memset( psz_value, 0, i_len );
sscanf( psz_string,"%*[^=]=\"%[^\0\r\t\n\"]", psz_value );
if( strlen( psz_value ) ) sscanf( psz_string, "%*[^=]=\"%[^\r\t\n\"]", psz_value );
return psz_value; return psz_value;
free( psz_value );
return NULL;
} }
This diff is collapsed.
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