while( cfg )
{
vlc_value_t val;
+ vlc_bool_t b_yes = VLC_TRUE;
if( cfg->psz_name == NULL || *cfg->psz_name == '\0' )
{
/* get the type of the variable */
i_type = config_GetType( p_this, psz_name );
- if( !i_type )
+ if( !i_type && !strncmp( cfg->psz_name, "no", 2 ) )
{
- /* TODO check for no, no- */
+ free( psz_name );
+ b_yes = VLC_FALSE;
+
+ if( !strncmp( cfg->psz_name, "no-", 3 ) )
+ {
+ asprintf( &psz_name, "%s%s", psz_prefix, cfg->psz_name + 3 );
+ }
+ else
+ {
+ asprintf( &psz_name, "%s%s", psz_prefix, cfg->psz_name + 2 );
+ }
+ i_type = config_GetType( p_this, psz_name );
}
if( !i_type )
switch( i_type )
{
+ case VLC_VAR_BOOL:
+ val.b_bool = b_yes;
+ break;
case VLC_VAR_INTEGER:
val.i_int = atoi( cfg->psz_value ? cfg->psz_value : "0" );
break;
case VLC_VAR_STRING:
val.psz_string = cfg->psz_value;
break;
-
- case VLC_VAR_BOOL:
default:
msg_Warn( p_this, "unhandled config var type" );
memset( &val, 0, sizeof( vlc_value_t ) );