config_GetPsz and uses the result instead.
* a52old.c: A52 decoder module main file
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: a52old.c,v 1.1 2002/08/04 17:23:42 sam Exp $
+ * $Id: a52old.c,v 1.2 2002/08/04 20:04:11 sam Exp $
*
* Authors: Michel Lespinasse <walken@zoy.org>
*
*****************************************************************************/
static int InitThread( a52dec_t * p_a52dec )
{
- char *psz_name;
-
/*
* Choose the best downmix module
*/
sizeof( downmix_t ) );
p_a52dec->p_downmix->psz_object_name = "downmix";
- psz_name = config_GetPsz( p_a52dec->p_downmix, "a52-downmix" );
p_a52dec->p_downmix->p_module =
- module_Need( p_a52dec->p_downmix, "downmix", psz_name );
- if( psz_name ) free( psz_name );
+ module_Need( p_a52dec->p_downmix, "downmix", "$a52-downmix" );
if( p_a52dec->p_downmix->p_module == NULL )
{
sizeof( imdct_t ) );
#define IMDCT p_a52dec->p_imdct
- psz_name = config_GetPsz( p_a52dec->p_fifo, "a52-imdct" );
p_a52dec->p_imdct->p_module =
- module_Need( p_a52dec->p_imdct, "imdct", psz_name );
- if( psz_name ) free( psz_name );
+ module_Need( p_a52dec->p_imdct, "imdct", "$a52-imdct" );
if( p_a52dec->p_imdct->p_module == NULL )
{
* video_parser.c : video parser thread
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: parser.c,v 1.2 2002/08/04 18:39:41 sam Exp $
+ * $Id: parser.c,v 1.3 2002/08/04 20:04:11 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Samuel Hocevar <sam@via.ecp.fr>
*****************************************************************************/
static int InitThread( vpar_thread_t *p_vpar )
{
- char *psz_name;
-
/*
* Choose the best motion compensation module
*/
- psz_name = config_GetPsz( p_vpar->p_fifo, "mpeg-motion" );
p_vpar->p_motion =
- module_Need( p_vpar->p_fifo, "motion compensation", psz_name );
- if( psz_name ) free( psz_name );
+ module_Need( p_vpar->p_fifo, "motion compensation", "$mpeg-motion" );
if( p_vpar->p_motion == NULL )
{
/*
* Choose the best IDCT module
*/
- psz_name = config_GetPsz( p_vpar->p_fifo, "mpeg-idct" );
- p_vpar->p_idct = module_Need( p_vpar->p_fifo, "idct", psz_name );
- if( psz_name ) free( psz_name );
+ p_vpar->p_idct = module_Need( p_vpar->p_fifo, "idct", "$mpeg-idct" );
if( p_vpar->p_idct == NULL )
{
* audio_output.c : audio output thread
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: audio_output.c,v 1.88 2002/08/04 17:23:44 sam Exp $
+ * $Id: audio_output.c,v 1.89 2002/08/04 20:04:11 sam Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
* Cyril Deguet <asmax@via.ecp.fr>
int i_channels, int i_rate )
{
aout_thread_t * p_aout; /* thread descriptor */
- char * psz_name;
int i_format;
/* Allocate descriptor */
}
/* Choose the best module */
- psz_name = config_GetPsz( p_aout, "aout" );
- p_aout->p_module = module_Need( p_aout, "audio output", psz_name );
- if( psz_name ) free( psz_name );
+ p_aout->p_module = module_Need( p_aout, "audio output", "$aout" );
if( p_aout->p_module == NULL )
{
msg_Err( p_aout, "no suitable aout module" );
* input_dec.c: Functions for the management of decoders
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: input_dec.c,v 1.41 2002/07/31 20:56:52 sam Exp $
+ * $Id: input_dec.c,v 1.42 2002/08/04 20:04:11 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
decoder_fifo_t * input_RunDecoder( input_thread_t * p_input,
es_descriptor_t * p_es )
{
- char * psz_plugin;
decoder_fifo_t *p_fifo;
/* Create the decoder configuration structure */
}
/* Get a suitable module */
- psz_plugin = config_GetPsz( p_fifo, "codec" );
- p_fifo->p_module = module_Need( p_fifo, "decoder", psz_plugin );
- if( psz_plugin ) free( psz_plugin );
+ p_fifo->p_module = module_Need( p_fifo, "decoder", "$codec" );
if( p_fifo->p_module == NULL )
{
msg_Err( p_fifo, "no suitable decoder module for fourcc `%4.4s'",
* interface, such as command line.
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
- * $Id: interface.c,v 1.97 2002/07/31 20:56:52 sam Exp $
+ * $Id: interface.c,v 1.98 2002/08/04 20:04:11 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
intf_thread_t* __intf_Create( vlc_object_t *p_this )
{
intf_thread_t * p_intf;
- char *psz_name;
/* Allocate structure */
p_intf = vlc_object_create( p_this, VLC_OBJECT_INTF );
}
/* Choose the best module */
- psz_name = config_GetPsz( p_intf, "intf" );
- p_intf->p_module = module_Need( p_intf, "interface", psz_name );
+ p_intf->p_module = module_Need( p_intf, "interface", "$intf" );
- if( psz_name ) free( psz_name );
if( p_intf->p_module == NULL )
{
msg_Err( p_intf, "no suitable intf module" );
* libvlc.c: main libvlc source
*****************************************************************************
* Copyright (C) 1998-2002 VideoLAN
- * $Id: libvlc.c,v 1.19 2002/07/31 20:56:52 sam Exp $
+ * $Id: libvlc.c,v 1.20 2002/08/04 20:04:11 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
vlc_error_t vlc_init_r( vlc_t *p_vlc, int i_argc, char *ppsz_argv[] )
{
char p_capabilities[200];
- char *psz_module;
char *p_tmp;
module_t *p_help_module;
playlist_t *p_playlist;
/*
* Choose the best memcpy module
*/
- psz_module = config_GetPsz( p_vlc, "memcpy" );
- p_vlc->p_memcpy_module = module_Need( p_vlc, "memcpy", psz_module );
- if( psz_module ) free( psz_module );
+ p_vlc->p_memcpy_module = module_Need( p_vlc, "memcpy", "$memcpy" );
if( p_vlc->p_memcpy_module == NULL )
{
* modules.c : Builtin and plugin modules management functions
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: modules.c,v 1.77 2002/08/04 17:23:44 sam Exp $
+ * $Id: modules.c,v 1.78 2002/08/04 20:04:11 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Ethan C. Baldridge <BaldridgeE@cadmus.com>
module_list_t *p_list, *p_first, *p_tmp;
int i_index = 0;
- vlc_bool_t b_intf = VLC_FALSE;
+ vlc_bool_t b_intf = VLC_FALSE, b_var = VLC_FALSE;
module_t *p_module;
msg_Dbg( p_this, "looking for %s module", psz_capability );
+ /* Deal with variables */
+ if( psz_name && psz_name[0] == '$' )
+ {
+ psz_name = config_GetPsz( p_this, psz_name + 1 );
+ b_var = ( psz_name != NULL );
+ }
+
/* Count how many different shortcuts were asked for */
if( psz_name && *psz_name )
{
/* If the user wants none, give him none. */
if( !strcmp( psz_name, "none" ) )
{
+ if( b_var ) free( psz_name );
return NULL;
}
free( psz_shortcuts );
}
+ if( b_var )
+ {
+ free( psz_name );
+ }
+
/* Don't forget that the module is still locked */
return p_module;
}