v4l2-ctl: Be consistent in handling v4l2_frequency.type for modulators
authorHans de Goede <hdegoede@redhat.com>
Sat, 26 May 2012 10:59:40 +0000 (12:59 +0200)
committerHans de Goede <hdegoede@redhat.com>
Sat, 26 May 2012 11:23:46 +0000 (13:23 +0200)
Currently for a S_FREQUENCY we set v4l2_frequency.type to V4L2_TUNER_RADIO,
but on G_FREQUENCY we leave it unset. The spec states that the type field
should be ignored by modulators, but since we're setting it on
S_FREQUENCY, lets be consistent and also set if on G_FREQUENCY.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
utils/v4l2-ctl/v4l2-ctl.cpp

index c8d929e..1fa2461 100644 (file)
@@ -3606,6 +3606,7 @@ int main(int argc, char **argv)
                double fac = 16;
 
                if (capabilities & V4L2_CAP_MODULATOR) {
+                       vf.type = V4L2_TUNER_RADIO;
                        if (doioctl(fd, VIDIOC_G_MODULATOR, &modulator) == 0)
                                fac = (modulator.capability & V4L2_TUNER_CAP_LOW) ? 16000 : 16;
                } else {