char **ppsz_action_text; /* Friendly names for actions */
int i_action; /* actions list size */
+ /* Deprecated */
+ char *psz_current; /* Good option name */
+ vlc_bool_t b_strict; /* Transitionnal or strict */
/* Misc */
vlc_mutex_t *p_lock; /* Lock to use when modifying the config */
vlc_bool_t b_dirty; /* Dirty flag to indicate a config change */
(i_config+11) * sizeof(module_config_t)); \
{ static module_config_t tmp = { CONFIG_ITEM_BOOL, NULL, name, '\0', text, longtext, NULL, b_value }; p_config[ i_config ] = tmp; p_config[ i_config ].pf_callback = p_callback; p_config[i_config].b_advanced = advc; }
+#define add_deprecated( name, strict ) \
+ i_config++; \
+ if(!(i_config%10)) p_config = (module_config_t* )realloc(p_config, \
+ (i_config+11) * sizeof(module_config_t)); \
+ { static module_config_t tmp={}; \
+ p_config[ i_config ] = tmp; \
+ p_config[ i_config ].i_type = p_config[ i_config -1 ].i_type; \
+ p_config[ i_config ].psz_name = name; \
+ p_config[i_config].b_strict = strict; \
+ p_config[ i_config ].psz_current = p_config[ i_config-1].psz_current?p_config[ i_config-1 ].psz_current:p_config[ i_config-1 ].psz_name; }
+
/* Modifier macros for the config options (used for fine tuning) */
#define change_short( ch ) \
p_config[i_config].i_short = ch;
set_subcategory( SUBCAT_VIDEO_VFILTER );
add_module_list_cat( "vout-filter", SUBCAT_VIDEO_VFILTER, NULL, NULL,
FILTER_TEXT, FILTER_LONGTEXT, VLC_FALSE );
-
+ add_deprecated( "filter", VLC_FALSE ); /*deprecated since 0.8.2 */
#if 0
add_string( "pixel-ratio", "1", NULL, PIXEL_RATIO_TEXT, PIXEL_RATIO_TEXT );
#endif
SUB_PATH_TEXT, SUB_PATH_LONGTEXT, VLC_TRUE );
add_integer( "sub-margin", -1, NULL, SUB_MARGIN_TEXT,
SUB_MARGIN_LONGTEXT, VLC_TRUE );
-
+ add_deprecated( "spu-margin", VLC_FALSE ); /*Deprecated since 0.8.2 */
set_section( N_( "Overlays" ) , NULL );
add_module_list_cat( "sub-filter", SUBCAT_VIDEO_SUBPIC, NULL, NULL,
SUB_FILTER_TEXT, SUB_FILTER_LONGTEXT, VLC_TRUE );
INPUT_PROGRAMS_TEXT, INPUT_PROGRAMS_LONGTEXT, VLC_FALSE );
add_integer( "audio-track", -1, NULL,
INPUT_AUDIOTRACK_TEXT, INPUT_AUDIOTRACK_LONGTEXT, VLC_FALSE );
+ add_deprecated( "audio-channel", VLC_FALSE ); /*deprecated since 0.8.2 */
add_integer( "sub-track", -1, NULL,
INPUT_SUBTRACK_TEXT, INPUT_SUBTRACK_LONGTEXT, VLC_FALSE );
+ add_deprecated("spu-channel",VLC_FALSE); /*deprecated since 0.8.2*/
add_string( "audio-language", "", NULL,
- INPUT_AUDIOTRACK_LANG_TEXT, INPUT_AUDIOTRACK_LANG_LONGTEXT, VLC_FALSE );
+ INPUT_AUDIOTRACK_LANG_TEXT, INPUT_AUDIOTRACK_LANG_LONGTEXT,
+ VLC_FALSE );
add_string( "sub-language", "", NULL,
- INPUT_SUBTRACK_LANG_TEXT, INPUT_SUBTRACK_LANG_LONGTEXT, VLC_FALSE );
+ INPUT_SUBTRACK_LANG_TEXT, INPUT_SUBTRACK_LANG_LONGTEXT,
+ VLC_FALSE );
set_section( N_( "Playback control" ) , NULL);
strdup( p_orig[i].psz_type ) : NULL;
p_module->p_config[i].psz_name = p_orig[i].psz_name ?
strdup( p_orig[i].psz_name ) : NULL;
+ p_module->p_config[i].psz_current = p_orig[i].psz_current?
+ strdup( p_orig[i].psz_current ) : NULL;
p_module->p_config[i].psz_text = p_orig[i].psz_text ?
strdup( _(p_orig[i].psz_text) ) : NULL;
p_module->p_config[i].psz_longtext = p_orig[i].psz_longtext ?
if( p_item->psz_name )
free( p_item->psz_name );
+ if( p_item->psz_current )
+ free( p_item->psz_current );
+
if( p_item->psz_text )
free( p_item->psz_text );
if( p_item->i_type & CONFIG_HINT )
/* ignore hints */
continue;
-
+ /* Ignore deprecated options */
+ if( p_item->psz_current )
+ continue;
if( b_autosave && !p_item->b_autosave )
{
i_value = p_item->i_value_saved;
/* Store the configuration option */
p_conf = config_FindConfig( p_this, psz_name );
+ if( p_conf )
+ {
+ /* Check if the option is derecated */
+ if( p_conf->psz_current )
+ {
+ if( !b_ignore_errors )
+ {
+ if( p_conf->b_strict )
+ {
+ fprintf( stderr,
+ "Error: option --%s is deprecated. "
+ "Use --%s instead.\n",
+ p_conf->psz_name, p_conf->psz_current);
+ /*free */
+ for( i_index = 0; p_longopts[i_index].name; i_index++ )
+ free( (char *)p_longopts[i_index].name );
+
+ free( p_longopts );
+ free( psz_shortopts );
+ return -1;
+ }
+ fprintf(stderr,
+ "Warning: option --%s is deprecated. "
+ "You should use --%s instead.\n",
+ p_conf->psz_name, p_conf->psz_current);
+ }
+ psz_name=p_conf->psz_current;
+ p_conf = config_FindConfig( p_this, psz_name );
+ }
- if( p_conf ) switch( p_conf->i_type )
+ switch( p_conf->i_type )
{
- case CONFIG_ITEM_STRING:
- case CONFIG_ITEM_FILE:
- case CONFIG_ITEM_DIRECTORY:
- case CONFIG_ITEM_MODULE:
- case CONFIG_ITEM_MODULE_LIST:
- case CONFIG_ITEM_MODULE_LIST_CAT:
- case CONFIG_ITEM_MODULE_CAT:
- config_PutPsz( p_this, psz_name, optarg );
- break;
- case CONFIG_ITEM_INTEGER:
- config_PutInt( p_this, psz_name, strtol(optarg, 0, 0));
- break;
- case CONFIG_ITEM_FLOAT:
- config_PutFloat( p_this, psz_name, (float)atof(optarg) );
- break;
- case CONFIG_ITEM_KEY:
- config_PutInt( p_this, psz_name, ConfigStringToKey( optarg ) );
- break;
- case CONFIG_ITEM_BOOL:
- config_PutInt( p_this, psz_name, !flag );
- break;
+ case CONFIG_ITEM_STRING:
+ case CONFIG_ITEM_FILE:
+ case CONFIG_ITEM_DIRECTORY:
+ case CONFIG_ITEM_MODULE:
+ case CONFIG_ITEM_MODULE_LIST:
+ case CONFIG_ITEM_MODULE_LIST_CAT:
+ case CONFIG_ITEM_MODULE_CAT:
+ config_PutPsz( p_this, psz_name, optarg );
+ break;
+ case CONFIG_ITEM_INTEGER:
+ config_PutInt( p_this, psz_name, strtol(optarg, 0, 0));
+ break;
+ case CONFIG_ITEM_FLOAT:
+ config_PutFloat( p_this, psz_name, (float)atof(optarg) );
+ break;
+ case CONFIG_ITEM_KEY:
+ config_PutInt( p_this, psz_name, ConfigStringToKey( optarg ) );
+ break;
+ case CONFIG_ITEM_BOOL:
+ config_PutInt( p_this, psz_name, !flag );
+ break;
}
continue;
}
-
- /* A short option has been recognized */
- if( pp_shortopts[i_cmd] != NULL )
+ }
+ /* A short option has been recognized */
+ if( pp_shortopts[i_cmd] != NULL )
+ {
+ switch( pp_shortopts[i_cmd]->i_type )
{
- switch( pp_shortopts[i_cmd]->i_type )
- {
case CONFIG_ITEM_STRING:
case CONFIG_ITEM_FILE:
case CONFIG_ITEM_DIRECTORY:
fprintf( stderr, "Try `%s --help' for more information.\n",
p_this->p_vlc->psz_object_name );
+ for( i_index = 0; p_longopts[i_index].name; i_index++ )
+ free( (char *)p_longopts[i_index].name );
free( p_longopts );
free( psz_shortopts );
return -1;