X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fdemux%2Fplaylist%2Fdvb.c;h=8145fd3cdbb80af2fde977c1993fdd84e1012105;hb=1c8685fb7d890424ec06ff9a2e3cbc1da984e617;hp=2ea17e11ab9d57e11c58be6dba4ea579a2dfd85b;hpb=0900f11014557ea895a290d2c1518d739f97a8b6;p=vlc diff --git a/modules/demux/playlist/dvb.c b/modules/demux/playlist/dvb.c index 2ea17e11ab..8145fd3cdb 100644 --- a/modules/demux/playlist/dvb.c +++ b/modules/demux/playlist/dvb.c @@ -24,10 +24,14 @@ /***************************************************************************** * Preamble *****************************************************************************/ -#include -#include -#include -#include "charset.h" +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include +#include +#include +#include #include "playlist.h" @@ -47,14 +51,14 @@ static int ParseLine( char *, char **, char ***, int *); /***************************************************************************** * Import_DVB: main import function *****************************************************************************/ -int E_(Import_DVB)( vlc_object_t *p_this ) +int Import_DVB( vlc_object_t *p_this ) { demux_t *p_demux = (demux_t *)p_this; - uint8_t *p_peek; + const uint8_t *p_peek; int i_peek; - vlc_bool_t b_valid = VLC_FALSE; + bool b_valid = false; - if( !isExtension( p_demux, ".conf" ) && !p_demux->b_force ) + if( !demux_IsPathExtension( p_demux, ".conf" ) && !p_demux->b_force ) return VLC_EGENERIC; /* Check if this really is a channels file */ @@ -70,7 +74,7 @@ int E_(Import_DVB)( vlc_object_t *p_this ) } psz_line[i] = 0; - if( ParseLine( psz_line, 0, 0, 0 ) ) b_valid = VLC_TRUE; + if( ParseLine( psz_line, 0, 0, 0 ) ) b_valid = true; } if( !b_valid ) return VLC_EGENERIC; @@ -85,8 +89,9 @@ int E_(Import_DVB)( vlc_object_t *p_this ) /***************************************************************************** * Deactivate: frees unused data *****************************************************************************/ -void E_(Close_DVB)( vlc_object_t *p_this ) +void Close_DVB( vlc_object_t *p_this ) { + VLC_UNUSED(p_this); } /***************************************************************************** @@ -112,24 +117,22 @@ static int Demux( demux_t *p_demux ) EnsureUTF8( psz_name ); - p_input = input_ItemNewExt( p_playlist, "dvb:", psz_name, 0, NULL, -1 ); + p_input = input_ItemNewExt( p_demux, "dvb://", psz_name, 0, NULL, -1 ); for( i = 0; i< i_options; i++ ) { EnsureUTF8( ppsz_options[i] ); input_ItemAddOption( p_input, ppsz_options[i] ); } - playlist_BothAddInput( p_playlist, p_input, p_item_in_category, - PLAYLIST_APPEND | PLAYLIST_SPREPARSE, - PLAYLIST_END, NULL, NULL ); - + input_ItemAddSubItem( p_current_input, p_input ); + vlc_gc_decref( p_input ); while( i_options-- ) free( ppsz_options[i_options] ); - if( ppsz_options ) free( ppsz_options ); + free( ppsz_options ); free( psz_line ); } HANDLE_PLAY_AND_RELEASE; - return -1; /* Needed for correct operation of go back */ + return 0; /* Needed for correct operation of go back */ } static struct @@ -177,6 +180,8 @@ static struct { "QAM_64", "dvb-modulation=64" }, { "QAM_128", "dvb-modulation=128" }, { "QAM_256", "dvb-modulation=256" }, + { "8VSB", "dvb-modulation=8" }, + { "16VSB", "dvb-modulation=16" }, { "TRANSMISSION_MODE_AUTO", "dvb-transmission=0" }, { "TRANSMISSION_MODE_2K", "dvb-transmission=2" }, @@ -190,7 +195,7 @@ static int ParseLine( char *psz_line, char **ppsz_name, { char *psz_name = 0, *psz_parse = psz_line; int i_count = 0, i_program = 0, i_frequency = 0; - vlc_bool_t b_valid = VLC_FALSE; + bool b_valid = false; if( pppsz_options ) *pppsz_options = 0; if( pi_options ) *pi_options = 0; @@ -201,7 +206,7 @@ static int ParseLine( char *psz_line, char **ppsz_name, *psz_parse == '\n' || *psz_parse == '\r' ) psz_parse++; /* Ignore comments */ - if( *psz_parse == '#' ) return VLC_FALSE; + if( *psz_parse == '#' ) return false; while( psz_parse ) { @@ -239,7 +244,7 @@ static int ParseLine( char *psz_line, char **ppsz_name, /* If we recognize one of the strings, then we are sure * the data is really valid (ie. a channels file). */ - b_valid = VLC_TRUE; + b_valid = true; break; } } @@ -275,7 +280,7 @@ static int ParseLine( char *psz_line, char **ppsz_name, { /* This isn't a valid channels file, cleanup everything */ while( (*pi_options)-- ) free( (*pppsz_options)[*pi_options] ); - if( *pppsz_options ) free( *pppsz_options ); + free( *pppsz_options ); *pppsz_options = 0; *pi_options = 0; } @@ -302,5 +307,6 @@ static int ParseLine( char *psz_line, char **ppsz_name, static int Control( demux_t *p_demux, int i_query, va_list args ) { + VLC_UNUSED(p_demux); VLC_UNUSED(i_query); VLC_UNUSED(args); return VLC_EGENERIC; }