Changeset b61c8fdebdb1260da5b9baa47bd9f0245be11252

Show
Ignore:
Timestamp:
04/03/08 00:55:40 (5 months ago)
Author:
Pierre d'Herbemont <pdherbemont@videolan.org>
git-committer:
Pierre d'Herbemont <pdherbemont@videolan.org> 1207176940 +0200
git-parent:

[aae60936d25a41b92b4827c2c7b32ee2b3b5266c]

git-author:
Pierre d'Herbemont <pdherbemont@videolan.org> 1207171323 +0200
Message:

libvlc: Add a --ignore-config options that allow not to use the config file. This is especially useful for libvlc based applications.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/libvlc-common.c

    rf88f1a7 rb61c8fd  
    395395    /* This ain't really nice to have to reload the config here but it seems 
    396396     * the only way to do it. */ 
    397     config_LoadConfigFile( p_libvlc, "main" ); 
     397 
     398    if( !config_GetInt( p_libvlc, "ignore-config" ) ) 
     399        config_LoadConfigFile( p_libvlc, "main" ); 
    398400    config_LoadCmdLine( p_libvlc, &i_argc, ppsz_argv, VLC_TRUE ); 
    399401 
     
    412414        module_EndBank( p_libvlc ); 
    413415        module_InitBank( p_libvlc ); 
    414         config_LoadConfigFile( p_libvlc, "main" ); 
     416        if( !config_GetInt( p_libvlc, "ignore-config" ) ) 
     417            config_LoadConfigFile( p_libvlc, "main" ); 
    415418        config_LoadCmdLine( p_libvlc, &i_argc, ppsz_argv, VLC_TRUE ); 
    416419        p_libvlc_global->p_module_bank->b_cache_delete = b_cache_delete; 
     
    466469 
    467470    /* Check for config file options */ 
    468     if( config_GetInt( p_libvlc, "reset-config" ) > 0 ) 
    469     { 
    470         config_ResetAll( p_libvlc ); 
    471         config_LoadCmdLine( p_libvlc, &i_argc, ppsz_argv, VLC_TRUE ); 
    472         config_SaveConfigFile( p_libvlc, NULL ); 
    473     } 
    474     if( config_GetInt( p_libvlc, "save-config" ) > 0 ) 
    475     { 
    476         config_LoadConfigFile( p_libvlc, NULL ); 
    477         config_LoadCmdLine( p_libvlc, &i_argc, ppsz_argv, VLC_TRUE ); 
    478         config_SaveConfigFile( p_libvlc, NULL ); 
     471    if( !config_GetInt( p_libvlc, "ignore-config" ) ) 
     472    { 
     473        if( config_GetInt( p_libvlc, "reset-config" ) > 0 ) 
     474        { 
     475            config_ResetAll( p_libvlc ); 
     476            config_LoadCmdLine( p_libvlc, &i_argc, ppsz_argv, VLC_TRUE ); 
     477            config_SaveConfigFile( p_libvlc, NULL ); 
     478        } 
     479        if( config_GetInt( p_libvlc, "save-config" ) > 0 ) 
     480        { 
     481            config_LoadConfigFile( p_libvlc, NULL ); 
     482            config_LoadCmdLine( p_libvlc, &i_argc, ppsz_argv, VLC_TRUE ); 
     483            config_SaveConfigFile( p_libvlc, NULL ); 
     484        } 
    479485    } 
    480486 
     
    493499     * Override default configuration with config file settings 
    494500     */ 
    495     config_LoadConfigFile( p_libvlc, NULL ); 
     501    if( !config_GetInt( p_libvlc, "ignore-config" ) ) 
     502        config_LoadConfigFile( p_libvlc, NULL ); 
    496503 
    497504    /* 
  • src/libvlc-module.c

    r885b6b8 rb61c8fd  
    24472447    N_("print help on a specific module (can be combined with --advanced " \ 
    24482448       "and --help-verbose)") 
     2449#define IGNORE_CONFIG_TEXT \ 
     2450    N_("no configuration option will be loaded nor saved to config file") 
    24492451#define SAVE_CONFIG_TEXT \ 
    24502452    N_("save the current command line options in the config") 
     
    24812483    add_string( "module", NULL, NULL, MODULE_TEXT, "", VLC_FALSE ); 
    24822484        change_short( 'p' ); 
     2485        change_internal(); 
     2486        change_unsaveable(); 
     2487    add_bool( "ignore-config", VLC_FALSE, NULL, IGNORE_CONFIG_TEXT, "", VLC_FALSE ); 
    24832488        change_internal(); 
    24842489        change_unsaveable();