[vlc-devel] [PATCH 5/7] config/chain: only create variable if it does not exists

Rémi Denis-Courmont remi at remlab.net
Wed Oct 12 21:30:18 CEST 2016


	Hello,

I don't think that's correct, insofar as the existing lifecycle model for 
variables is retained. I also don't really see the point.

Le mercredi 12 octobre 2016, 19:39:37 Filip Roséen a écrit :
> ---
>  src/config/chain.c | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/src/config/chain.c b/src/config/chain.c
> index 7d0b71d..e20585d 100644
> --- a/src/config/chain.c
> +++ b/src/config/chain.c
> @@ -281,9 +281,13 @@ void config_ChainParse( vlc_object_t *p_this, const
> char *psz_prefix,
> 
>          char name[plen + strlen( optname )];
>          snprintf( name, sizeof (name), "%s%s", psz_prefix, optname );
> -        if( var_Create( p_this, name,
> -                        config_GetType( p_this, name ) | VLC_VAR_DOINHERIT
> ) ) -            return /* VLC_xxx */;
> +
> +        if( var_Type( p_this, name ) == 0 )
> +        {
> +            if( var_Create( p_this, name, config_GetType( p_this, name ) |
> +                                          VLC_VAR_DOINHERIT ) )
> +                return /* VLC_xxx */;
> +        }
>      }
> 
>      /* Now parse options and set value */

-- 
Rémi Denis-Courmont
http://www.remlab.net/



More information about the vlc-devel mailing list