Skip to content
Snippets Groups Projects
Commit 2f5d21d6 authored by Romain Vimont's avatar Romain Vimont Committed by Romain Vimont
Browse files

config: use correct constants

The value returned by config_GetType() is one of the VLC_VAR_*.
The value of param->item.i_type is one of the CONFIG_ITEM_*.

The function config_GetType() both finds the vlc_param from a name and
converts the type.

Since commit 82956e7b, the type is not
converted anymore, so it must be compared against CONFIG_ITEM_*
constants directly.

In practice, an internal vflip flag was not correct, so the OpenGL
filter output was vflipped:

    ./vlc --video-filter=opengl --opengl-filter=mock video.mp4
parent 1efb1ff8
No related branches found
No related tags found
Loading
Pipeline #157060 passed with stage
in 19 minutes and 54 seconds
......@@ -375,12 +375,12 @@ void config_ChainParse( vlc_object_t *p_this, const char *psz_prefix,
/* get the type of the variable */
const int i_type = param->item.i_type;
if( i_type != VLC_VAR_BOOL && cfg->psz_value == NULL )
if( i_type != CONFIG_ITEM_BOOL && cfg->psz_value == NULL )
{
msg_Warn( p_this, "missing value for option %s", cfg->psz_name );
continue;
}
if( i_type != VLC_VAR_STRING && b_once )
if( i_type != CONFIG_ITEM_STRING && b_once )
{
msg_Warn( p_this, "*option_name need to be a string option" );
continue;
......@@ -388,17 +388,17 @@ void config_ChainParse( vlc_object_t *p_this, const char *psz_prefix,
switch( i_type )
{
case VLC_VAR_BOOL:
case CONFIG_ITEM_BOOL:
val.b_bool = b_yes;
break;
case VLC_VAR_INTEGER:
case CONFIG_ITEM_INTEGER:
val.i_int = strtoll( cfg->psz_value ? cfg->psz_value : "0",
NULL, 0 );
break;
case VLC_VAR_FLOAT:
case CONFIG_ITEM_FLOAT:
val.f_float = us_atof( cfg->psz_value ? cfg->psz_value : "0" );
break;
case VLC_VAR_STRING:
case CONFIG_ITEM_STRING:
val.psz_string = cfg->psz_value;
break;
default:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment