[MPlayer-dev-eng] [PATCH] Fix broken build by checking for used structure definition

Erik Auerswald auerswal at unix-ag.uni-kl.de
Sat Feb 20 19:20:10 CET 2016


Hi,

the attached patch fixes a build error if the header linux/videodev2.h
defines struct v4l2_ext_controls, but not struct v4l2_query_ext_ctrl. This
is the case on Ubuntu 14.04.4 LTS, for example.

Build error:

---8<------8<------8<------8<------8<------8<------8<------8<---

stream/stream_pvr.c: In function 'add_v4l2_ext_control':
stream/stream_pvr.c:1099:10: error: variable 'qctrl' has initializer but incomplete type
   struct v4l2_query_ext_ctrl qctrl = { .id = id };
          ^
stream/stream_pvr.c:1099:10: error: unknown field 'id' specified in initializer
stream/stream_pvr.c:1099:10: warning: excess elements in struct initializer [enabled by default]
stream/stream_pvr.c:1099:10: warning: (near initialization for 'qctrl') [enabled by default]
stream/stream_pvr.c:1099:30: error: storage size of 'qctrl' isn't known
   struct v4l2_query_ext_ctrl qctrl = { .id = id };
                              ^
stream/stream_pvr.c:1102:27: error: 'VIDIOC_QUERY_EXT_CTRL' undeclared (first use in this function)
   if (ioctl (pvr->dev_fd, VIDIOC_QUERY_EXT_CTRL, &qctrl) < 0)
                           ^
stream/stream_pvr.c:1102:27: note: each undeclared identifier is reported only once for each function it appears in
stream/stream_pvr.c:1099:30: warning: unused variable 'qctrl' [-Wunused-variable]
   struct v4l2_query_ext_ctrl qctrl = { .id = id };
                              ^
make: *** [stream/stream_pvr.o] Error 1
make: *** Waiting for unfinished jobs....

---8<------8<------8<------8<------8<------8<------8<------8<---

Thanks,
Erik
-- 
http://www.unix-ag.uni-kl.de/~auerswal/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mplayer-configure-check_for_v4l2_query_ext_ctrl.patch
Type: text/x-diff
Size: 475 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20160220/eb677609/attachment.patch>


More information about the MPlayer-dev-eng mailing list