<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta http-equiv="Content-Style-Type" content="text/css" />
  <meta name="generator" content="pandoc" />
  <title></title>
  <style type="text/css">code{white-space: pre;}</style>
</head>
<body>
<p>Attached are all the patches in this patch-batch rebased to account for the fact that original patch <code>#5</code> should not be merged.</p>
<p>See the below linked message for more information:</p>
<ul>
<li>https://mailman.videolan.org/pipermail/vlc-devel/2016-October/109833.html</li>
</ul>
<p>The final diff between the previous patch-batch and the ones attached to this email is as the below (the indentation has changed due to one less if-branch, other than that the code is equivalent).</p>
<pre><code>diff --git a/src/config/chain.c b/src/config/chain.c
index 0e42fb8..660ad8f 100644
--- a/src/config/chain.c
+++ b/src/config/chain.c
@@ -283,30 +283,25 @@ 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 )
+        module_config_t* p_conf = config_FindConfig( p_this, name );
+        if( p_conf )
         {
-            if( var_Create( p_this, name, config_GetType( p_this, name ) |
-                                          VLC_VAR_DOINHERIT ) )
-                return /* VLC_xxx */;
-
-            module_config_t* p_conf = config_FindConfig( p_this, name );
-
-            if( p_conf )
+            switch( CONFIG_CLASS( p_conf->i_type ) )
             {
-                switch( CONFIG_CLASS( p_conf->i_type ) )
-                {
-                    case CONFIG_ITEM_INTEGER:
-                        var_Change( p_this, name, VLC_VAR_SETMINMAX,
-                            &(vlc_value_t){ .i_int = p_conf->min.i },
-                            &(vlc_value_t){ .i_int = p_conf->max.i } );
-                        break;
-                    case CONFIG_ITEM_FLOAT:
-                        var_Change( p_this, name, VLC_VAR_SETMINMAX,
-                            &(vlc_value_t){ .f_float = p_conf->min.f },
-                            &(vlc_value_t){ .f_float = p_conf->max.f } );
-                        break;
-                }
+                case CONFIG_ITEM_INTEGER:
+                    var_Change( p_this, name, VLC_VAR_SETMINMAX,
+                        &(vlc_value_t){ .i_int = p_conf->min.i },
+                        &(vlc_value_t){ .i_int = p_conf->max.i } );
+                    break;
+                case CONFIG_ITEM_FLOAT:
+                    var_Change( p_this, name, VLC_VAR_SETMINMAX,
+                        &(vlc_value_t){ .f_float = p_conf->min.f },
+                        &(vlc_value_t){ .f_float = p_conf->max.f } );
+                    break;
             }
         }
     }</code></pre>
<p>Best Regards,<br />
Filip</p>
<p>On 2016-10-12 19:39, Filip Roséen wrote:</p>
<blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;color:#500050">
<pre><code> These patches are all related to have variables with ranges are handled when
 created through the command-line, or during config-chain parsing.

 In short, the below tickets are fixed:

     - https://trac.videolan.org/vlc/ticket/17430
     - https://trac.videolan.org/vlc/ticket/17431

 It should however be noted that the changes in these patch also fixes
 modules that have been written under the assumption that their
 specified variable ranges are honored (in such a way that they cannot
 receive values outside of the specified range).

 I found it hard to come up with some suitable ascii-art that is
 related to variables, so below is some sort of dancing bear/bunny
 hybrid.

                              (') (')
                               (o.o)
                             ,-(   )-'
                              (")-(")

 Filip Roséen (6):
   vlc_variables: add VLC_VAR_SETMINMAX
   access/v4l2: use VLC_VAR_SETMINMAX
   modules/entry: specify default range for floats
   config/chain: only create variable if it does not exists
   config/chain: respect ranges when creating variables
   config/cmdline: respect ranges when creating variables

  include/vlc_variables.h        |  1 +
  modules/access/v4l2/controls.c | 28 ++++++++++++----------------
  src/config/chain.c             | 31 ++++++++++++++++++++++++++++---
  src/config/cmdline.c           |  6 ++++++
  src/misc/variables.c           | 19 +++++++++++++++++++
  src/modules/entry.c            |  6 ++++++
  6 files changed, 72 insertions(+), 19 deletions(-)

 -- 
 2.10.0
 </code></pre>
</blockquote>
</body>
</html>