[vlc-commits] [Git][videolan/vlc][master] config: use correct constants

Rémi Denis-Courmont (@Courmisch) gitlab at videolan.org
Tue Nov 9 17:13:10 UTC 2021



Rémi Denis-Courmont pushed to branch master at VideoLAN / VLC


Commits:
2f5d21d6 by Romain Vimont at 2021-11-09T16:12:21+00:00
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 82956e7bc69c0b29059543c19e143561421e4131, 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

- - - - -


1 changed file:

- src/config/chain.c


Changes:

=====================================
src/config/chain.c
=====================================
@@ -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:



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/2f5d21d6d82167882a255e7e52e3be7a04285780

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/2f5d21d6d82167882a255e7e52e3be7a04285780
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list