[vlc-commits] variables: improve CheckValue
Zhao Zhili
git at videolan.org
Wed Aug 29 17:17:19 CEST 2018
vlc | branch: master | Zhao Zhili <quinkblack at foxmail.com> | Tue Aug 28 11:50:05 2018 +0800| [cc9d3c003d5c440818de174c1193b374bbf8750c] | committer: Jean-Baptiste Kempf
variables: improve CheckValue
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=cc9d3c003d5c440818de174c1193b374bbf8750c
---
src/misc/variables.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/misc/variables.c b/src/misc/variables.c
index d53364258a..8efac4449c 100644
--- a/src/misc/variables.c
+++ b/src/misc/variables.c
@@ -195,7 +195,7 @@ static void CheckValue(variable_t *var, vlc_value_t *val)
case VLC_VAR_INTEGER:
if (val->i_int < var->min.i_int)
val->i_int = var->min.i_int;
- if (val->i_int > var->max.i_int)
+ else if (val->i_int > var->max.i_int)
val->i_int = var->max.i_int;
if (var->step.i_int != 0 && (val->i_int % var->step.i_int))
{
@@ -211,7 +211,7 @@ static void CheckValue(variable_t *var, vlc_value_t *val)
case VLC_VAR_FLOAT:
if (isless(val->f_float, var->min.f_float))
val->f_float = var->min.f_float;
- if (isgreater(val->f_float, var->max.f_float))
+ else if (isgreater(val->f_float, var->max.f_float))
val->f_float = var->max.f_float;
if (var->step.f_float != 0.f)
val->f_float = var->step.f_float
More information about the vlc-commits
mailing list