[PATCH] stream_pvr: retain compatibility with older v4l2

Reza Arbab <[email protected]>
Newsgroups gmane.comp.video.mplayer.devel
Message-ID <[email protected]>
Do not break systems which do not yet have VIDIOC_QUERY_EXT_CTRL.

Signed-off-by: Reza Arbab <[email protected]>
---
 configure           | 1 -
 stream/stream_pvr.c | 2 ++
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index b0324f7..63732a0 100755
--- a/configure
+++ b/configure
@@ -7762,7 +7762,6 @@ if test "$_pvr" = auto && test "$_tv_v4l2" = yes && linux ; then
 #include <linux/videodev2.h>
 int main(void) {
   struct v4l2_ext_controls ext;
-  struct v4l2_query_ext_ctrl qctrl;
   return ext.controls->value;
 }
 EOF
diff --git a/stream/stream_pvr.c b/stream/stream_pvr.c
index 5c5ff96..c6f6d18 100644
--- a/stream/stream_pvr.c
+++ b/stream/stream_pvr.c
@@ -1096,6 +1096,7 @@ static void
 add_v4l2_ext_control (struct v4l2_ext_controls *ctrls, struct pvr_t *pvr,
                       uint32_t id, int32_t value)
 {
+#ifdef VIDIOC_QUERY_EXT_CTRL
   struct v4l2_query_ext_ctrl qctrl = { .id = id };
 
   /* add only if the device supports this control */
@@ -1120,6 +1121,7 @@ add_v4l2_ext_control (struct v4l2_ext_controls *ctrls, struct pvr_t *pvr,
       return;
     }
   }
+#endif
 
   ctrls->controls[ctrls->count].id = id;
   ctrls->controls[ctrls->count].value = value;
-- 
2.5.0

_______________________________________________
MPlayer-dev-eng mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/mplayer-dev-eng
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.