[vlc-commits] variables: set VLC_VAR_HASCHOICE in var_Type() if there are choices

Rémi Denis-Courmont git at videolan.org
Thu Oct 23 20:19:37 CEST 2014


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Oct 23 20:54:24 2014 +0300| [abe0b91d0f5fa70e43f8ae4b7d8e752078cce8fe] | committer: Rémi Denis-Courmont

variables: set VLC_VAR_HASCHOICE in var_Type() if there are choices

This allows adding choices as mere suggestions rather than strict set
of choices (just don´t set VLC_VAR_HASCHOICE in var_Create()).

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=abe0b91d0f5fa70e43f8ae4b7d8e752078cce8fe
---

 src/misc/variables.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/misc/variables.c b/src/misc/variables.c
index 5b4ec0d..cea07ed 100644
--- a/src/misc/variables.c
+++ b/src/misc/variables.c
@@ -672,8 +672,11 @@ int var_Type( vlc_object_t *p_this, const char *psz_name )
 
     p_var = Lookup( p_this, psz_name );
     if( p_var != NULL )
+    {
         i_type = p_var->i_type;
-
+        if( p_var->choices.i_count > 0 )
+            i_type |= VLC_VAR_HASCHOICE;
+    }
     vlc_mutex_unlock( &p_priv->var_lock );
 
     return i_type;



More information about the vlc-commits mailing list