Skip to content

Commit

Permalink
variables: correct minimum float value
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Psilokos authored and tguillem committed Jun 22, 2017
1 parent de5e761 commit c95d5fb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/misc/variables.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit c95d5fb

Please sign in to comment.