aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2014-12-08 10:28:51 +0100
committerHans Verkuil <hans.verkuil@cisco.com>2014-12-08 10:28:51 +0100
commite8d0e58338404872bab0bbe17eaec75818433090 (patch)
treefae55cc6e6540762ff3f9f7d7fa212cb2d6aacf2
parent111691ada1d70054d460bdb305e8c7818fca540a (diff)
v4l2-compliance: fix compilation problem
For some reason some compiler versions seem to dislike this: struct v4l2_selection sel = { .type = ..., .target = ..., }; Not sure why, but just revert to initialize the old-fashioned way. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
-rw-r--r--utils/v4l2-compliance/v4l2-test-input-output.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/utils/v4l2-compliance/v4l2-test-input-output.cpp b/utils/v4l2-compliance/v4l2-test-input-output.cpp
index 63c90d7e..4b1ad1f4 100644
--- a/utils/v4l2-compliance/v4l2-test-input-output.cpp
+++ b/utils/v4l2-compliance/v4l2-test-input-output.cpp
@@ -364,11 +364,8 @@ int testTunerHwSeek(struct node *node)
static int checkInput(struct node *node, const struct v4l2_input &descr, unsigned i)
{
- struct v4l2_selection sel = {
- .type = V4L2_BUF_TYPE_VIDEO_CAPTURE,
- .target = V4L2_SEL_TGT_NATIVE_SIZE,
- };
__u32 mask = (1 << node->audio_inputs) - 1;
+ struct v4l2_selection sel;
if (descr.index != i)
return fail("invalid index\n");
@@ -384,6 +381,9 @@ static int checkInput(struct node *node, const struct v4l2_input &descr, unsigne
return fail("invalid std\n");
if ((descr.capabilities & V4L2_IN_CAP_STD) && !descr.std)
return fail("std == 0\n");
+ memset(&sel, 0, sizeof(sel));
+ sel.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+ sel.target = V4L2_SEL_TGT_NATIVE_SIZE;
if (descr.capabilities & V4L2_IN_CAP_NATIVE_SIZE) {
fail_on_test(doioctl(node, VIDIOC_G_SELECTION, &sel));
fail_on_test(doioctl(node, VIDIOC_S_SELECTION, &sel));
@@ -729,11 +729,8 @@ int testModulatorFreq(struct node *node)
static int checkOutput(struct node *node, const struct v4l2_output &descr, unsigned o)
{
- struct v4l2_selection sel = {
- .type = V4L2_BUF_TYPE_VIDEO_OUTPUT,
- .target = V4L2_SEL_TGT_NATIVE_SIZE,
- };
__u32 mask = (1 << node->audio_outputs) - 1;
+ struct v4l2_selection sel;
if (descr.index != o)
return fail("invalid index\n");
@@ -749,6 +746,9 @@ static int checkOutput(struct node *node, const struct v4l2_output &descr, unsig
return fail("invalid std\n");
if ((descr.capabilities & V4L2_OUT_CAP_STD) && !descr.std)
return fail("std == 0\n");
+ memset(&sel, 0, sizeof(sel));
+ sel.type = V4L2_BUF_TYPE_VIDEO_OUTPUT;
+ sel.target = V4L2_SEL_TGT_NATIVE_SIZE;
if (descr.capabilities & V4L2_OUT_CAP_NATIVE_SIZE) {
fail_on_test(doioctl(node, VIDIOC_G_SELECTION, &sel));
fail_on_test(doioctl(node, VIDIOC_S_SELECTION, &sel));

Privacy Policy