X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fdemux%2Fplaylist%2Fdvb.c;h=7f6d4e7de1dc457a3345935c7b2eda6233fb14ea;hb=6ee1e193fd896ab9a4729fde14f009d9ce629815;hp=403d5e3fafcb0cd1e9467233586e7fc3863ebd79;hpb=982c2c891aa4dc440fe65009993004b52534b577;p=vlc diff --git a/modules/demux/playlist/dvb.c b/modules/demux/playlist/dvb.c index 403d5e3faf..7f6d4e7de1 100644 --- a/modules/demux/playlist/dvb.c +++ b/modules/demux/playlist/dvb.c @@ -25,9 +25,9 @@ * Preamble *****************************************************************************/ #include -#include -#include -#include "charset.h" +#include +#include +#include #include "playlist.h" @@ -54,7 +54,7 @@ int E_(Import_DVB)( vlc_object_t *p_this ) int i_peek; vlc_bool_t b_valid = VLC_FALSE; - if( !isExtension( p_demux, ".conf" ) && !p_demux->b_force ) + if( !demux2_IsPathExtension( p_demux, ".conf" ) && !p_demux->b_force ) return VLC_EGENERIC; /* Check if this really is a channels file */ @@ -95,6 +95,7 @@ void E_(Close_DVB)( vlc_object_t *p_this ) static int Demux( demux_t *p_demux ) { char *psz_line; + input_item_t *p_input; INIT_PLAYLIST_STUFF; while( (psz_line = stream_ReadLine( p_demux->s )) ) @@ -115,12 +116,9 @@ static int Demux( demux_t *p_demux ) for( i = 0; i< i_options; i++ ) { EnsureUTF8( ppsz_options[i] ); - vlc_input_item_AddOption( p_input, ppsz_options[i] ); + input_ItemAddOption( p_input, ppsz_options[i] ); } - 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 ); while( i_options-- ) free( ppsz_options[i_options] ); if( ppsz_options ) free( ppsz_options ); @@ -129,13 +127,13 @@ static int Demux( demux_t *p_demux ) } HANDLE_PLAY_AND_RELEASE; - return VLC_SUCCESS; + return -1; /* Needed for correct operation of go back */ } static struct { - char *psz_name; - char *psz_option; + const char *psz_name; + const char *psz_option; } dvb_options[] = { @@ -205,7 +203,7 @@ static int ParseLine( char *psz_line, char **ppsz_name, while( psz_parse ) { - char *psz_option = 0; + const char *psz_option = 0; char *psz_end = strchr( psz_parse, ':' ); if( psz_end ) { *psz_end = 0; psz_end++; } @@ -261,9 +259,10 @@ static int ParseLine( char *psz_line, char **ppsz_name, if( psz_option && pppsz_options && pi_options ) { - psz_option = strdup( psz_option ); - INSERT_ELEM( *pppsz_options, (*pi_options), (*pi_options), - psz_option ); + char *psz_dup = strdup( psz_option ); + if (psz_dup != NULL) + INSERT_ELEM( *pppsz_options, (*pi_options), (*pi_options), + psz_dup ); } psz_parse = psz_end;