[vlc-commits] config/cmdline: respect ranges when creating variables

Filip Roséen git at videolan.org
Thu Oct 13 18:05:39 CEST 2016


vlc | branch: master | Filip Roséen <filip at atch.se> | Wed Oct 12 19:39:39 2016 +0200| [8eaf19335c460e966e3379d062ee5d5355203fac] | committer: Thomas Guillem

config/cmdline: respect ranges when creating variables

When creating variables that has their origin on the command-line, we
need to make sure that their lower and upperbound is honored.

fixes #17430

Signed-off-by: Thomas Guillem <thomas at gllm.fr>

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

 src/config/cmdline.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/config/cmdline.c b/src/config/cmdline.c
index 12e92ba..5f1e390 100644
--- a/src/config/cmdline.c
+++ b/src/config/cmdline.c
@@ -239,11 +239,17 @@ int config_LoadCmdLine( vlc_object_t *p_this, int i_argc,
                         break;
                     case CONFIG_ITEM_INTEGER:
                         var_Create( p_this, psz_name, VLC_VAR_INTEGER );
+                        var_Change( p_this, psz_name, VLC_VAR_SETMINMAX,
+                            &(vlc_value_t){ .i_int = p_conf->min.i },
+                            &(vlc_value_t){ .i_int = p_conf->max.i } );
                         var_SetInteger( p_this, psz_name,
                                         strtoll(state.arg, NULL, 0));
                         break;
                     case CONFIG_ITEM_FLOAT:
                         var_Create( p_this, psz_name, VLC_VAR_FLOAT );
+                        var_Change( p_this, psz_name, VLC_VAR_SETMINMAX,
+                            &(vlc_value_t){ .f_float = p_conf->min.f },
+                            &(vlc_value_t){ .f_float = p_conf->max.f } );
                         var_SetFloat( p_this, psz_name, us_atof(state.arg) );
                         break;
                     case CONFIG_ITEM_BOOL:



More information about the vlc-commits mailing list