aboutsummaryrefslogtreecommitdiffstats
path: root/src/videoinput.c
diff options
context:
space:
mode:
authorvektor <devnull@localhost>2005-03-30 02:55:44 (GMT)
committervektor <devnull@localhost>2005-03-30 02:55:44 (GMT)
commit3dbb36eb84df1a885bdbc30d8d985fcff0c09f19 (patch)
treeb8a0e8c86338cabb26c3e6d34ec47f7e098a620e /src/videoinput.c
parent5f0ba969293cea480099d058c309e188ec3ac913 (diff)
* tvtime/src/videoinput.c: Don't set the volume if it is disabled.
Thanks to Martijn Lina for this suggestion.
Diffstat (limited to 'src/videoinput.c')
-rw-r--r--src/videoinput.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/videoinput.c b/src/videoinput.c
index 7678d9f..c46ae2e 100644
--- a/src/videoinput.c
+++ b/src/videoinput.c
@@ -942,7 +942,7 @@ static double videoinput_get_control_v4l2( videoinput_t *vidin, uint32_t id )
struct v4l2_queryctrl query;
query.id = id;
- if( ioctl( vidin->grab_fd, VIDIOC_QUERYCTRL, &query ) >= 0 ) {
+ if( ioctl( vidin->grab_fd, VIDIOC_QUERYCTRL, &query ) >= 0 && !(query.flags & V4L2_CTRL_FLAG_DISABLED) ) {
struct v4l2_control control;
control.id = id;
if( ioctl( vidin->grab_fd, VIDIOC_G_CTRL, &control ) >= 0 ) {
@@ -957,7 +957,7 @@ static void videoinput_set_control_v4l2( videoinput_t *vidin, uint32_t id, doubl
struct v4l2_queryctrl query;
query.id = id;
- if( ioctl( vidin->grab_fd, VIDIOC_QUERYCTRL, &query ) >= 0 ) {
+ if( ioctl( vidin->grab_fd, VIDIOC_QUERYCTRL, &query ) >= 0 && !(query.flags & V4L2_CTRL_FLAG_DISABLED) ) {
struct v4l2_control control;
control.id = id;
control.value = query.minimum + ((int) ((val * ((double) (query.maximum - query.minimum))) + 0.5));

Privacy Policy