libv4l: Fix black screen on devices with hardware gamma control
authorhans@rhel5-devel.localdomain <hans@rhel5-devel.localdomain>
Wed, 27 May 2009 18:05:11 +0000 (20:05 +0200)
committerhans@rhel5-devel.localdomain <hans@rhel5-devel.localdomain>
Wed, 27 May 2009 18:05:11 +0000 (20:05 +0200)
From: Hans de Goede <hdegoede@redhat.com>

libv4l: Fix black screen on devices with hardware gamma control

Priority: normal

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
lib/ChangeLog
lib/libv4lconvert/processing/gamma.c

index 83fa29a..3f709a6 100644 (file)
@@ -1,6 +1,7 @@
 libv4l-0.6
 ----------
 * Link libv4lconvert with -lm for powf by Gregor Jasny
+* Fix black screen on devices with hardware gamma control
 
 libv4l-0.5.98
 -------------
index 7695abc..fcb5bb0 100644 (file)
@@ -23,7 +23,9 @@
 #define CLIP(color) (unsigned char)(((color)>0xff)?0xff:(((color)<0)?0:(color)))
 
 static int gamma_active(struct v4lprocessing_data *data) {
-  return v4lcontrol_get_ctrl(data->control, V4LCONTROL_GAMMA) != 1000;
+  int gamma = v4lcontrol_get_ctrl(data->control, V4LCONTROL_GAMMA);
+
+  return gamma && gamma != 1000;
 }
 
 static int gamma_calculate_lookup_tables(