[vlc-commits] variables: correct minimum float value

Victorien Le Couviour--Tuffet git at videolan.org
Thu Jun 22 09:16:55 CEST 2017


vlc | branch: master | Victorien Le Couviour--Tuffet <victorien.lecouviour.tuffet at gmail.com> | Wed Jun 21 16:12:00 2017 +0200| [c95d5fbea2122ac471f8aee86ee9f1cafeddeb00] | committer: Thomas Guillem

variables: correct minimum float value

FLT_MIN is the minimum normalized positive floating-point value not the minimum
negative value a float can contain. This is very different.  This fixes the
issue with the adjust's hue variable, which has a range of [-180;180]. When the
variable was set lower than 0, it was clipped back to zero.

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

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

 src/misc/variables.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/misc/variables.c b/src/misc/variables.c
index 610e414593..d441684c06 100644
--- a/src/misc/variables.c
+++ b/src/misc/variables.c
@@ -340,7 +340,7 @@ int var_Create( vlc_object_t *p_this, const char *psz_name, int i_type )
         case VLC_VAR_FLOAT:
             p_var->ops = &float_ops;
             p_var->val.f_float = 0.f;
-            p_var->min.f_float = FLT_MIN;
+            p_var->min.f_float = -FLT_MAX;
             p_var->max.f_float = FLT_MAX;
             break;
         case VLC_VAR_COORDS:



More information about the vlc-commits mailing list