/*****************************************************************************
* Preamble
*****************************************************************************/
-#include <vlc/vlc.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <vlc_common.h>
#include <vlc_demux.h>
#include <vlc_interface.h>
#include <vlc_charset.h>
/*****************************************************************************
* 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;
const uint8_t *p_peek;
int i_peek;
- vlc_bool_t b_valid = VLC_FALSE;
+ bool b_valid = false;
- if( !demux2_IsPathExtension( 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 */
}
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;
/*****************************************************************************
* 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);
}
/*****************************************************************************
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] );
}
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
{
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;
*psz_parse == '\n' || *psz_parse == '\r' ) psz_parse++;
/* Ignore comments */
- if( *psz_parse == '#' ) return VLC_FALSE;
+ if( *psz_parse == '#' ) return false;
while( psz_parse )
{
/* 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;
}
}
{
/* 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;
}
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;
}