Commit 7f583e05 authored by Gildas Bazin's avatar Gildas Bazin


* New GTK configuration interface. This interface is generated dynamically
  at run-time from the configuration data contained in each plugin.
* config_PutPszVariable and config_GetPszVariable are now thread safe.
* Few modifications/optimizations to the config module.
* Got rid of all the _VAR macros in config.h

This is the first version of the GTK configuration interface. There are still
a few raw corners and a fews things left to do, but it basically does what
I wanted.
Constructive comments like it sucks or it smells rotten fish are of course
very welcome. And if there are GTK gurus out there, please don't hesitate to
add your touch.

I also started to add usefull comments to the configuration options but I'm not
really good at this kind of thing so if people want to help, they can finish
the job. For this look at all the *_LONGTEXT macros at the top of main.c

(PS: Translations will also be appreciated but not right now as the interface
will likely change again in the few coming days)
parent e7608d4b
......@@ -3,7 +3,7 @@
* Collection of useful common types and macros definitions
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: common.h,v 1.84 2002/03/04 23:56:37 massiot Exp $
* $Id: common.h,v 1.85 2002/03/11 07:23:09 gbazin Exp $
*
* Authors: Samuel Hocevar <sam@via.ecp.fr>
* Vincent Seguin <seguin@via.ecp.fr>
......@@ -463,6 +463,7 @@ typedef __int64 off_t;
typedef struct module_symbols_s
{
struct main_s* p_main;
struct module_bank_s* p_module_bank;
struct input_bank_s* p_input_bank;
struct aout_bank_s* p_aout_bank;
struct vout_bank_s* p_vout_bank;
......@@ -472,8 +473,7 @@ typedef struct module_symbols_s
void ( * config_PutIntVariable ) ( const char *, int );
void ( * config_PutPszVariable ) ( const char *, char * );
struct module_config_s * ( * config_FindConfig ) ( const char * );
struct module_config_s * ( * config_Duplicate ) ( struct module_config_s *,
int );
struct module_config_s * ( * config_Duplicate ) ( struct module_s * );
struct intf_subscription_s * ( * intf_MsgSub ) ( void );
void ( * intf_MsgUnsub ) ( struct intf_subscription_s * );
......
......@@ -114,7 +114,7 @@
/* #define AOUT_FORMAT_DEFAULT AOUT_FMT_U16_LE */
/* Volume */
#define VOLUME_DEFAULT 512
#define VOLUME_DEFAULT 256
#define VOLUME_STEP 128
#define VOLUME_MAX 1024
......@@ -253,138 +253,3 @@
/* Maximal size of the message queue - in case of overflow, all messages in the
* queue are printed, but not sent to the threads */
#define INTF_MSG_QSIZE 256
/****************************************************************************
* Macros for the names of the main options
* Instead of directly manipulating the option names, we define macros for
* them. This makes sense only for the main options (ie. only the ones defined
* in main.c) because they are widely used.
* We won't bother doing this for plugins as plugin specific options should
* by definition be restricted in useage to the plugin that defines them.
*
****************************************************************************/
/*
* Interface option names
*/
/* Variable containing the display method */
#define INTF_METHOD_VAR "intf"
/* Variable used to store startup script */
#define INTF_INIT_SCRIPT_VAR "vlcrc"
/* Default search path for interface file browser */
#define INTF_PATH_VAR "search_path"
/* Interface warnig message level */
#define INTF_WARNING_VAR "warning"
/* Variable to enable stats mode */
#define INTF_STATS_VAR "stats"
/*
* Audio output option names
*/
/* Variable to disable the audio output */
#define AOUT_NOAUDIO_VAR "noaudio"
/* Variable containing the audio output method */
#define AOUT_METHOD_VAR "aout"
/* Variable for spdif mode */
#define AOUT_SPDIF_VAR "spdif"
/* Variable for volume */
#define AOUT_VOLUME_VAR "volume"
/* Variable for mono */
#define AOUT_MONO_VAR "audio_mono"
/* Variable for output rate */
#define AOUT_RATE_VAR "audio_rate"
/* Variable for output rate */
#define AOUT_DESYNC_VAR "audio_desync"
/*
* Video output option names
*/
/* Variable to disable the video output */
#define VOUT_NOVIDEO_VAR "novideo"
/* Variable containing the display method */
#define VOUT_METHOD_VAR "vout"
/* Variable used in place of DISPLAY if available */
#define VOUT_DISPLAY_VAR "display"
/* Dimensions for display window */
#define VOUT_WIDTH_VAR "width"
#define VOUT_HEIGHT_VAR "height"
/* Variable for grayscale output mode */
#define VOUT_GRAYSCALE_VAR "grayscale"
/* Variable for fullscreen mode */
#define VOUT_FULLSCREEN_VAR "fullscreen"
/* Variable for overlay mode */
#define VOUT_NOOVERLAY_VAR "nooverlay"
/* Variable containing the filter method */
#define VOUT_FILTER_VAR "filter"
/* Variable containing the SPU margin */
#define VOUT_SPUMARGIN_VAR "spumargin"
/*
* Input option names
*/
/* Variable containing the input method */
#define INPUT_METHOD_VAR "input"
/* Input port */
#define INPUT_PORT_VAR "server_port"
/* Channels mode */
#define INPUT_NETWORK_CHANNEL_VAR "network_channel"
/* Variable containing channel server and port */
#define INPUT_CHANNEL_SERVER_VAR "channel_server"
#define INPUT_CHANNEL_PORT_VAR "channel_port"
/* Variable containing network interface */
#define INPUT_IFACE_VAR "iface"
#define INPUT_AUDIO_VAR "input_audio"
#define INPUT_CHANNEL_VAR "input_channel"
#define INPUT_SUBTITLE_VAR "input_subtitle"
/* DVD defaults */
#define INPUT_DVD_DEVICE_VAR "dvd_device"
/* VCD defaults */
#define INPUT_VCD_DEVICE_VAR "vcd_device"
/* IPv6, IPv4 */
#define INPUT_IPV6_VAR "6"
#define INPUT_IPV4_VAR "4"
/*
* Decoders option names
*/
/* Variables for audio decoders */
#define ADEC_MPEG_VAR "mpeg_adec"
#define ADEC_AC3_VAR "ac3_adec"
/* The synchro variable name */
#define VPAR_SYNCHRO_VAR "vpar_synchro"
/* Variable containing the SMP value */
#define VDEC_SMP_VAR "vdec_smp"
/*
* Playlist option names
*/
/* Launch on start-up */
#define PLAYLIST_STARTUP_VAR "playlist_on_startup"
/* Enqueue drag'n dropped item */
#define PLAYLIST_ENQUEUE_VAR "playlist_enqueue"
/* Loop on playlist end */
#define PLAYLIST_LOOP_VAR "playlist_loop"
/*
* CPU options
*/
#define NOMMX_VAR "nommx"
#define NO3DN_VAR "no3dn"
#define NOMMXEXT_VAR "nommxext"
#define NOSSE_VAR "nosse"
#define NOALTIVEC_VAR "noaltivec"
/*
* Misc option names
*/
/* Variable containing the memcpy method */
#define MEMCPY_METHOD_VAR "memcpy"
......@@ -4,7 +4,7 @@
* It includes functions allowing to declare, get or set configuration options.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: configuration.h,v 1.1 2002/02/24 20:51:09 gbazin Exp $
* $Id: configuration.h,v 1.2 2002/03/11 07:23:09 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
......@@ -27,29 +27,34 @@
* Macros used to build the configuration structure.
*****************************************************************************/
/* Mandatory last part of the structure */
#define MODULE_CONFIG_ITEM_END 0x000 /* End of config */
/* Configuration hint types */
#define MODULE_CONFIG_HINT_END 0x0001 /* End of config */
#define MODULE_CONFIG_HINT_CATEGORY 0x0002 /* Start of new category */
#define MODULE_CONFIG_HINT_SUBCATEGORY 0x0003 /* Start of sub-category */
#define MODULE_CONFIG_HINT_SUBCATEGORY_END 0x0004 /* End of sub-category */
/* Configuration widgets */
#define MODULE_CONFIG_ITEM_CATEGORY 0x0001 /* Start of new category */
#define MODULE_CONFIG_ITEM_SUBCATEGORY 0x0002 /* Start of sub-category */
#define MODULE_CONFIG_ITEM_SUBCATEGORY_END 0x0003 /* End of sub-category */
#define MODULE_CONFIG_ITEM_STRING 0x0004 /* String option */
#define MODULE_CONFIG_ITEM_FILE 0x0005 /* File option */
#define MODULE_CONFIG_ITEM_PLUGIN 0x0006 /* Plugin option */
#define MODULE_CONFIG_ITEM_INTEGER 0x0007 /* Integer option */
#define MODULE_CONFIG_ITEM_BOOL 0x0008 /* Bool option */
#define MODULE_CONFIG_ITEM_ALIAS 0x0009 /* Alias option */
#define MODULE_CONFIG_HINT 0x000F
/* Configuration item types */
#define MODULE_CONFIG_ITEM_STRING 0x0010 /* String option */
#define MODULE_CONFIG_ITEM_FILE 0x0020 /* File option */
#define MODULE_CONFIG_ITEM_PLUGIN 0x0030 /* Plugin option */
#define MODULE_CONFIG_ITEM_INTEGER 0x0040 /* Integer option */
#define MODULE_CONFIG_ITEM_BOOL 0x0050 /* Bool option */
#define MODULE_CONFIG_ITEM_ALIAS 0x0060 /* Alias option */
#define MODULE_CONFIG_ITEM 0x00F0
typedef struct module_config_s
{
int i_type; /* Configuration type */
char * psz_name; /* Option name */
char * psz_text; /* Short comment on the configuration option */
char * psz_longtext; /* Long comment on the configuration option */
char * psz_value; /* Option value */
char *psz_name; /* Option name */
char *psz_text; /* Short comment on the configuration option */
char *psz_longtext; /* Long comment on the configuration option */
char *psz_value; /* Option value */
int i_value; /* Option value */
void * p_callback; /* Function to call when commiting a change */
void *p_callback; /* Function to call when commiting a change */
vlc_mutex_t *p_lock; /* lock to use when modifying the config */
boolean_t b_dirty; /* Dirty flag to indicate a config change */
} module_config_t;
......@@ -65,8 +70,7 @@ void config_PutIntVariable( const char *psz_name, int i_value );
void config_PutPszVariable( const char *psz_name, char *psz_value );
module_config_t *config_FindConfig( const char *psz_name );
module_config_t *config_Duplicate ( module_config_t *p_config_orig,
int i_config_options );
module_config_t *config_Duplicate ( module_t *p_module );
#else
# define config_GetIntVariable p_symbols->config_GetIntVariable
# define config_PutIntVariable p_symbols->config_PutIntVariable
......@@ -92,25 +96,29 @@ module_config_t *config_Duplicate ( module_config_t *p_config_orig,
static module_config_t p_config[] = {
#define MODULE_CONFIG_STOP \
{ MODULE_CONFIG_ITEM_END, NULL, NULL, NULL, NULL, 0, NULL, 0 } };
{ MODULE_CONFIG_HINT_END, NULL, NULL, NULL, NULL, 0, NULL, 0 } };
#define ADD_CATEGORY_HINT( text, longtext ) \
{ MODULE_CONFIG_ITEM_CATEGORY, NULL, text, longtext, NULL, 0, NULL, 0 },
{ MODULE_CONFIG_HINT_CATEGORY, NULL, text, longtext, NULL, 0, NULL, \
NULL, 0 },
#define ADD_SUBCATEGORY_HINT( text, longtext ) \
{ MODULE_CONFIG_ITEM_SUBCATEGORY, NULL, text, longtext, NULL, 0, NULL, 0 },
{ MODULE_CONFIG_HINT_SUBCATEGORY, NULL, text, longtext, NULL, 0, NULL, \
NULL, 0 },
#define END_SUBCATEGORY_HINT \
{ MODULE_CONFIG_ITEM_SUBCATEGORY_END, NULL, NULL, NULL, NULL, 0, NULL, 0 },
{ MODULE_CONFIG_HINT_SUBCATEGORY_END, NULL, NULL, NULL, NULL, 0, NULL, \
NULL, 0 },
#define ADD_STRING( name, value, p_callback, text, longtext ) \
{ MODULE_CONFIG_ITEM_STRING, name, text, longtext, value, 0, \
p_callback, 0 },
p_callback, NULL, 0 },
#define ADD_FILE( name, psz_value, p_callback, text, longtext ) \
{ MODULE_CONFIG_ITEM_FILE, name, text, longtext, psz_value, 0, \
p_callback, 0 },
p_callback, NULL, 0 },
#define ADD_PLUGIN( name, i_capability, psz_value, p_callback, text, longtext)\
{ MODULE_CONFIG_ITEM_PLUGIN, name, text, longtext, psz_value, \
i_capability, p_callback, 0 },
i_capability, p_callback, NULL, 0 },
#define ADD_INTEGER( name, i_value, p_callback, text, longtext ) \
{ MODULE_CONFIG_ITEM_INTEGER, name, text, longtext, NULL, i_value, \
p_callback, 0 },
p_callback, NULL, 0 },
#define ADD_BOOL( name, p_callback, text, longtext ) \
{ MODULE_CONFIG_ITEM_BOOL, name, text, longtext, NULL, 0, p_callback, 0 },
{ MODULE_CONFIG_ITEM_BOOL, name, text, longtext, NULL, 0, p_callback, \
NULL, 0 },
......@@ -2,7 +2,7 @@
* modules.h : Module management functions.
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: modules.h,v 1.44 2002/03/01 00:33:18 massiot Exp $
* $Id: modules.h,v 1.45 2002/03/11 07:23:09 gbazin Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -87,7 +87,7 @@ static __inline__ char *GetCapabilityName( unsigned int i_capa )
*****************************************************************************
* This global variable is accessed by any function using modules.
*****************************************************************************/
typedef struct
typedef struct module_bank_s
{
struct module_s * first; /* First module in the bank */
int i_count; /* Number of allocated modules */
......@@ -96,7 +96,11 @@ typedef struct
it is to design thread-safe linked lists */
} module_bank_t;
#ifndef PLUGIN
extern module_bank_t *p_module_bank;
#else
# define p_module_bank (p_symbols->p_module_bank)
#endif
/*****************************************************************************
* Module description structure
......@@ -121,8 +125,15 @@ typedef struct module_s
u32 i_cpu_capabilities; /* Required CPU capabilities */
struct module_functions_s *p_functions; /* Capability functions */
struct module_config_s *p_config; /* Module configuration structure */
int i_config_options; /* number of configuration options */
/*
* Variables set by the module to store its config options
*/
struct module_config_s *p_config; /* Module configuration structure */
struct module_config_s *p_config_orig; /* original module config data */
vlc_mutex_t config_lock; /* lock used to modify the config */
int i_config_lines; /* number of configuration lines */
int i_config_items; /* number of configuration items */
/*
* Variables used internally by the module manager
......
......@@ -2,7 +2,7 @@
* modules_inner.h : Macros used from within a module.
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: modules_inner.h,v 1.12 2002/02/24 20:51:09 gbazin Exp $
* $Id: modules_inner.h,v 1.13 2002/03/11 07:23:09 gbazin Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -90,9 +90,19 @@
#define MODULE_INIT_STOP \
STORE_SYMBOLS; \
p_module->pp_shortcuts[ i_shortcut ] = NULL; \
p_module->i_config_options = sizeof(p_config)/sizeof(module_config_t);\
p_module->p_config = config_Duplicate( p_config, \
p_module->i_config_options ); \
p_module->i_config_items = 0; \
for( p_module->i_config_lines = 0; \
p_module->i_config_lines < (sizeof(p_config)/ \
sizeof(module_config_t)); \
p_module->i_config_lines++ ) \
{ \
if( p_config[p_module->i_config_lines].i_type & \
MODULE_CONFIG_ITEM ) \
p_module->i_config_items++; \
} \
vlc_mutex_init( &p_module->config_lock ); \
p_module->p_config_orig = p_config; \
p_module->p_config = config_Duplicate( p_module ); \
if( p_module->p_config == NULL ) \
{ \
intf_ErrMsg( MODULE_STRING \
......@@ -130,6 +140,7 @@
{ \
p_module->p_functions = \
( module_functions_t * )malloc( sizeof( module_functions_t ) ); \
p_module->p_config_orig = p_config; \
if( p_module->p_functions == NULL ) \
{ \
return( -1 ); \
......@@ -148,6 +159,7 @@
#define MODULE_DEACTIVATE_START \
int __VLC_SYMBOL( DeactivateModule )( module_t *p_module ) \
{ \
p_module->p_config_orig = NULL; \
free( p_module->p_functions );
#define MODULE_DEACTIVATE_STOP \
......
......@@ -2,7 +2,7 @@
* ac3_spdif.c: ac3 pass-through to external decoder with enabled soundcard
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: ac3_spdif.c,v 1.18 2002/03/04 01:53:56 stef Exp $
* $Id: ac3_spdif.c,v 1.19 2002/03/11 07:23:09 gbazin Exp $
*
* Authors: Stphane Borel <stef@via.ecp.fr>
* Juha Yrjola <jyrjola@cc.hut.fi>
......@@ -70,7 +70,7 @@ void _M( adec_getfunctions )( function_list_t * p_function_list )
*****************************************************************************/
MODULE_CONFIG_START
ADD_CATEGORY_HINT( "Misc Options", NULL )
ADD_BOOL( AOUT_SPDIF_VAR, NULL, "enable AC3 pass-through mode", NULL )
ADD_BOOL( "spdif", NULL, "enable AC3 pass-through mode", NULL )
MODULE_CONFIG_STOP
MODULE_INIT_START
......@@ -93,7 +93,7 @@ MODULE_DEACTIVATE_STOP
*****************************************************************************/
static int decoder_Probe( u8 *pi_type )
{
return( ( config_GetIntVariable( AOUT_SPDIF_VAR )
return( ( config_GetIntVariable( "spdif" )
&& *pi_type == AC3_AUDIO_ES ) ? 0 : -1 );
}
......
......@@ -2,7 +2,7 @@
* http.c: HTTP access plug-in
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
* $Id: http.c,v 1.2 2002/03/04 23:56:37 massiot Exp $
* $Id: http.c,v 1.3 2002/03/11 07:23:09 gbazin Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -230,11 +230,11 @@ static int HTTPOpen( input_thread_t * p_input )
}
p_access_data->psz_network = NULL;
if( config_GetIntVariable( INPUT_IPV4_VAR ) )
if( config_GetIntVariable( "ipv4" ) )
{
p_access_data->psz_network = "ipv4";
}
if( config_GetIntVariable( INPUT_IPV6_VAR ) )
if( config_GetIntVariable( "ipv6" ) )
{
p_access_data->psz_network = "ipv6";
}
......
......@@ -2,7 +2,7 @@
* udp.c: raw UDP access plug-in
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
* $Id: udp.c,v 1.2 2002/03/04 23:56:37 massiot Exp $
* $Id: udp.c,v 1.3 2002/03/11 07:23:09 gbazin Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -107,11 +107,11 @@ static int UDPOpen( input_thread_t * p_input )
int i_bind_port = 0, i_server_port = 0;
network_socket_t socket_desc;
if( config_GetIntVariable( INPUT_IPV4_VAR ) )
if( config_GetIntVariable( "ipv4" ) )
{
psz_network = "ipv4";
}
if( config_GetIntVariable( INPUT_IPV6_VAR ) )
if( config_GetIntVariable( "ipv6" ) )
{
psz_network = "ipv6";
}
......
......@@ -2,7 +2,7 @@
* vout_directx.c: Windows DirectX video output display method
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: vout_directx.c,v 1.23 2002/02/24 20:51:09 gbazin Exp $
* $Id: vout_directx.c,v 1.24 2002/03/11 07:23:09 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
......@@ -134,7 +134,7 @@ static int vout_Create( vout_thread_t *p_vout )
p_vout->p_sys->b_caps_overlay_clipping = 0;
SetRectEmpty( &p_vout->p_sys->rect_display );
p_vout->p_sys->b_using_overlay =
!config_GetIntVariable( VOUT_NOOVERLAY_VAR );
!config_GetIntVariable( "nooverlay" );
p_vout->p_sys->b_cursor = 1;
......@@ -157,8 +157,8 @@ static int vout_Create( vout_thread_t *p_vout )
}
#if 0
p_vout->p_sys->i_window_width = config_GetIntVariable( VOUT_WIDTH_VAR );
p_vout->p_sys->i_window_height = config_GetIntVariable( VOUT_HEIGHT_VAR );
p_vout->p_sys->i_window_width = config_GetIntVariable( "width" );
p_vout->p_sys->i_window_height = config_GetIntVariable( "height" );
#endif
/* Set locks and condition variables */
......
......@@ -2,7 +2,7 @@
* aout_dsp.c : dsp functions library
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: aout_dsp.c,v 1.25 2002/02/27 18:19:21 sam Exp $
* $Id: aout_dsp.c,v 1.26 2002/03/11 07:23:09 gbazin Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
......@@ -236,7 +236,11 @@ static void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
{
if( p_aout->b_active )
{
write( p_aout->p_sys->i_fd, buffer, i_size );
int i_tmp;
i_tmp = write( p_aout->p_sys->i_fd, buffer, i_size );
if( i_tmp < 0 )
intf_ErrMsg("aout error: %s", strerror(ENOMEM) );
}
}
......
......@@ -8,7 +8,7 @@
* -dvd_udf to find files
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* $Id: dvd_access.c,v 1.5 2002/03/09 16:48:33 stef Exp $
* $Id: dvd_access.c,v 1.6 2002/03/11 07:23:09 gbazin Exp $
*
* Author: Stphane Borel <stef@via.ecp.fr>
*
......@@ -781,7 +781,7 @@ static char * DVDParse( input_thread_t * p_input )
/* no device and no access specified: we probably don't want DVD */
return NULL;
}
psz_device = config_GetPszVariable( INPUT_DVD_DEVICE_VAR );
psz_device = config_GetPszVariable( "dvd_device" );
}
/* check block device */
......
/* dvd_es.c: functions to find and select ES
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* $Id: dvd_es.c,v 1.2 2002/03/08 22:58:12 stef Exp $
* $Id: dvd_es.c,v 1.3 2002/03/11 07:23:09 gbazin Exp $
*
* Author: Stphane Borel <stef@via.ecp.fr>
*
......@@ -245,15 +245,15 @@ void DVDLaunchDecoders( input_thread_t * p_input )
if( p_main->b_audio && p_dvd->i_audio_nb > 0 )
{
/* For audio: first one if none or a not existing one specified */
i_audio = config_GetIntVariable( INPUT_CHANNEL_VAR );
i_audio = config_GetIntVariable( "input_channel" );
if( i_audio <= 0 || i_audio > p_dvd->i_audio_nb )
{
config_PutIntVariable( INPUT_CHANNEL_VAR, 1 );
config_PutIntVariable( "input_channel", 1 );
i_audio = 1;
}
if( config_GetIntVariable( AOUT_SPDIF_VAR ) ||
( config_GetIntVariable( INPUT_AUDIO_VAR ) ==
if( config_GetIntVariable( "spdif" ) ||
( config_GetIntVariable( "input_audio" ) ==
REQUESTED_AC3 ) )
{
int i_ac3 = i_audio;
......@@ -280,10 +280,10 @@ void DVDLaunchDecoders( input_thread_t * p_input )
if( p_main->b_video && p_dvd->i_spu_nb > 0 )
{
/* for spu, default is none */
i_spu = config_GetIntVariable( INPUT_SUBTITLE_VAR );
i_spu = config_GetIntVariable( "input_subtitle" );
if( i_spu < 0 || i_spu > p_dvd->i_spu_nb )
{
config_PutIntVariable( INPUT_SUBTITLE_VAR, 0 );
config_PutIntVariable( "input_subtitle", 0 );
i_spu = 0;
}
if( i_spu > 0 )
......
......@@ -6,7 +6,7 @@
* It depends on: libdvdread for ifo files and block reading.
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: input_dvdread.c,v 1.31 2002/03/06 16:39:37 stef Exp $
* $Id: input_dvdread.c,v 1.32 2002/03/11 07:23:09 gbazin Exp $
*
* Author: Stphane Borel <stef@via.ecp.fr>
*
......@@ -284,7 +284,7 @@ static int DvdReadOpen( struct input_thread_s *p_input )
free( psz_orig );
return -1;
}
psz_source = config_GetPszVariable( INPUT_DVD_DEVICE_VAR );
psz_source = config_GetPszVariable( "dvd_device" );
}
if( stat( psz_source, &stat_info ) == -1 )
......@@ -1208,16 +1208,16 @@ static void DvdReadLauchDecoders( input_thread_t * p_input )
if( p_main->b_audio )
{
/* For audio: first one if none or a not existing one specified */
int i_audio = config_GetIntVariable( INPUT_CHANNEL_VAR );
int i_audio = config_GetIntVariable( "input_channel" );
if( i_audio < 0 /*|| i_audio > i_audio_nb*/ )
{
config_PutIntVariable( INPUT_CHANNEL_VAR, 1 );
config_PutIntVariable( "input_channel", 1 );
i_audio = 1;
}
if( i_audio > 0/* && i_audio_nb > 0*/ )
{
if( config_GetIntVariable( AOUT_SPDIF_VAR ) ||
( config_GetIntVariable( INPUT_AUDIO_VAR ) ==
if( config_GetIntVariable( "spdif" ) ||
( config_GetIntVariable( "input_audio" ) ==
REQUESTED_AC3 ) )
{
int i_ac3 = i_audio;
......@@ -1244,10 +1244,10 @@ static void DvdReadLauchDecoders( input_thread_t * p_input )
if( p_main->b_video )
{
/* for spu, default is none */
int i_spu = config_GetIntVariable( INPUT_SUBTITLE_VAR );
int i_spu = config_GetIntVariable( "input_subtitle" );
if( i_spu < 0 /*|| i_spu > i_spu_nb*/ )
{
config_PutIntVariable( INPUT_SUBTITLE_VAR, 0 );
config_PutIntVariable( "input_subtitle", 0 );
i_spu = 0;
}
if( i_spu > 0 /*&& i_spu_nb > 0*/ )
......
......@@ -2,7 +2,7 @@
* deinterlace.c : deinterlacer plugin for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: deinterlace.c,v 1.6 2002/02/24 20:51:09 gbazin Exp $
* $Id: deinterlace.c,v 1.7 2002/03/11 07:23:09 gbazin Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -125,10 +125,10 @@ static int vout_Create( vout_thread_t *p_vout )
/* Look what method was requested */
if( !(psz_method = psz_method_tmp
= config_GetPszVariable( VOUT_FILTER_VAR )) )
= config_GetPszVariable( "filter" )) )
{
intf_ErrMsg( "vout error: configuration variable %s empty",
VOUT_FILTER_VAR );
"filter" );
return( 1 );
}
......@@ -188,8 +188,8 @@ static int vout_Init( vout_thread_t *p_vout )
}
/* Try to open the real video output, with half the height our images */
psz_filter = config_GetPszVariable( VOUT_FILTER_VAR );
config_PutPszVariable( VOUT_FILTER_VAR, NULL );
psz_filter = config_GetPszVariable( "filter" );
config_PutPszVariable( "filter", NULL );
intf_WarnMsg( 1, "filter: spawning the real video output" );
......@@ -227,7 +227,7 @@ static int vout_Init( vout_thread_t *p_vout )
break;
}
config_PutPszVariable( VOUT_FILTER_VAR, psz_filter );
config_PutPszVariable( "filter", psz_filter );
if( psz_filter ) free( psz_filter );
/* Everything failed */
......