From 6ced02a5fd04c06f95dc3b445f994315ebcd88fd Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 12 Jul 2007 08:10:28 -0300 Subject: Fix tuner max range From: Mauro Carvalho Chehab By default, tuner-core reports max range as the maximum possible unsigned int. Since qv4l2 uses QSpinBox to display frequency ranges, and this waits for a signed integer, it is considering the maximum value as being -1. This hack will trunc any value bigger than the maximum signed integer to the max value. Signed-off-by: Mauro Carvalho Chehab --- v4l2-apps/util/qv4l2/general-tab.cpp | 2 ++ 1 file changed, 2 insertions(+) --- v4l2-apps/util/qv4l2/general-tab.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'v4l2-apps/util/qv4l2/general-tab.cpp') diff --git a/v4l2-apps/util/qv4l2/general-tab.cpp b/v4l2-apps/util/qv4l2/general-tab.cpp index 87a0f520d..93ab329ba 100644 --- a/v4l2-apps/util/qv4l2/general-tab.cpp +++ b/v4l2-apps/util/qv4l2/general-tab.cpp @@ -41,6 +41,8 @@ GeneralTab::GeneralTab(int _fd, int n, QWidget *parent) : memset(&tuner, 0, sizeof(tuner)); ioctl(fd, VIDIOC_G_TUNER, &tuner); + if (tuner.rangehigh>INT_MAX) + tuner.rangehigh=INT_MAX; struct v4l2_input vin; memset(&vin, 0, sizeof(vin)); -- cgit v1.2.3