[vlc-devel] [vlc-commits] Add V4L2 64-bits integer controls (refs #5302)

Pierre Ynard linkfanel at yahoo.fr
Sun Oct 2 01:50:34 CEST 2011


> +    struct v4l2_ext_control ext_ctrl = {
> +        .id = c->id,
> +        .size = 0,
> +        .value64 = value,
> +    };

value64 is in an unnamed union. Is this valid C99? This causes an error
with gcc-4.5:

v4l2/controls.c:109:9: error: unknown field 'value64' specified in initializer
v4l2/controls.c:109:9: warning: missing braces around initializer
v4l2/controls.c:109:9: warning: (near initialization for 'ext_ctrl.reserved2')

It seems to build fine with the following work around:


diff --git a/modules/access/v4l2/controls.c b/modules/access/v4l2/controls.c
index 9d4ad2a..2f34456 100644
--- a/modules/access/v4l2/controls.c
+++ b/modules/access/v4l2/controls.c
@@ -106,8 +106,8 @@ static int ControlSet64 (const vlc_v4l2_ctrl_t *c, int64_t value)
     struct v4l2_ext_control ext_ctrl = {
         .id = c->id,
         .size = 0,
-        .value64 = value,
     };
+    ext_ctrl.value64 = value;
     struct v4l2_ext_controls ext_ctrls = {
         .ctrl_class = V4L2_CTRL_ID2CLASS(c->id),
         .count = 1,


-- 
Pierre Ynard
"Une âme dans un corps, c'est comme un dessin sur une feuille de papier."



More information about the vlc-devel mailing list