[vlc-commits] access/v4l2: use VLC_VAR_SETMINMAX
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:34 2016 +0200| [cc956a7f0b0d4a9da0ab2d2281451f306e0027e5] | committer: Thomas Guillem
access/v4l2: use VLC_VAR_SETMINMAX
Signed-off-by: Thomas Guillem <thomas at gllm.fr>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=cc956a7f0b0d4a9da0ab2d2281451f306e0027e5
---
modules/access/v4l2/controls.c | 28 ++++++++++++----------------
1 file changed, 12 insertions(+), 16 deletions(-)
diff --git a/modules/access/v4l2/controls.c b/modules/access/v4l2/controls.c
index def7403..52879c5 100644
--- a/modules/access/v4l2/controls.c
+++ b/modules/access/v4l2/controls.c
@@ -392,10 +392,9 @@ static vlc_v4l2_ctrl_t *ControlAddInteger (vlc_object_t *obj, int fd,
val.i_int = ctrl.value;
var_Change (obj, c->name, VLC_VAR_SETVALUE, &val, NULL);
}
- val.i_int = query->minimum;
- var_Change (obj, c->name, VLC_VAR_SETMIN, &val, NULL);
- val.i_int = query->maximum;
- var_Change (obj, c->name, VLC_VAR_SETMAX, &val, NULL);
+ var_Change (obj, c->name, VLC_VAR_SETMINMAX,
+ &(vlc_value_t){ .i_int = query->minimum },
+ &(vlc_value_t){ .i_int = query->maximum } );
if (query->step != 1)
{
val.i_int = query->step;
@@ -467,10 +466,9 @@ static vlc_v4l2_ctrl_t *ControlAddMenu (vlc_object_t *obj, int fd,
val.i_int = ctrl.value;
var_Change (obj, c->name, VLC_VAR_SETVALUE, &val, NULL);
}
- val.i_int = query->minimum;
- var_Change (obj, c->name, VLC_VAR_SETMIN, &val, NULL);
- val.i_int = query->maximum;
- var_Change (obj, c->name, VLC_VAR_SETMAX, &val, NULL);
+ var_Change (obj, c->name, VLC_VAR_SETMINMAX,
+ &(vlc_value_t){ .i_int = query->minimum },
+ &(vlc_value_t){ .i_int = query->maximum } );
val.i_int = query->default_value;
var_Change (obj, c->name, VLC_VAR_SETDEFAULT, &val, NULL);
@@ -629,10 +627,9 @@ static vlc_v4l2_ctrl_t *ControlAddBitMask (vlc_object_t *obj, int fd,
val.i_int = ctrl.value;
var_Change (obj, c->name, VLC_VAR_SETVALUE, &val, NULL);
}
- val.i_int = 0;
- var_Change (obj, c->name, VLC_VAR_SETMIN, &val, NULL);
- val.i_int = (uint32_t)query->maximum;
- var_Change (obj, c->name, VLC_VAR_SETMAX, &val, NULL);
+ var_Change (obj, c->name, VLC_VAR_SETMINMAX,
+ &(vlc_value_t){ .i_int = 0 },
+ &(vlc_value_t){ .i_int = (uint32_t)query->maximum } );
val.i_int = query->default_value;
var_Change (obj, c->name, VLC_VAR_SETDEFAULT, &val, NULL);
return c;
@@ -666,10 +663,9 @@ static vlc_v4l2_ctrl_t *ControlAddIntMenu (vlc_object_t *obj, int fd,
val.i_int = ctrl.value;
var_Change (obj, c->name, VLC_VAR_SETVALUE, &val, NULL);
}
- val.i_int = query->minimum;
- var_Change (obj, c->name, VLC_VAR_SETMIN, &val, NULL);
- val.i_int = query->maximum;
- var_Change (obj, c->name, VLC_VAR_SETMAX, &val, NULL);
+ var_Change (obj, c->name, VLC_VAR_SETMINMAX,
+ &(vlc_value_t){ .i_int = query->minimum },
+ &(vlc_value_t){ .i_int = query->maximum } );
val.i_int = query->default_value;
var_Change (obj, c->name, VLC_VAR_SETDEFAULT, &val, NULL);
More information about the vlc-commits
mailing list