Fix comparison of the tuner norms
authorBrijesh Singh <brijesh.ksingh@gmail.com>
Fri, 30 Jan 2009 13:40:51 +0000 (14:40 +0100)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Fri, 30 Jan 2009 13:42:44 +0000 (14:42 +0100)
The V4L2 tuner norms that a device supports could
be a subset of some norm (e.g. NTSC instead of NTSC_M).
The comparison should be done by & instead of ==.

See http://www.linuxtv.org/downloads/video4linux/API/V4L2_API/spec-single/v4l2.html#STANDARD

Fixes bug #569820.

sys/v4l2/gstv4l2tuner.c

index e9f5af54df84a43c380e408e4e370dfd7738d113..c5f84426bde878021d24d0d5a5a1bcd78b89e5e1 100644 (file)
@@ -246,7 +246,7 @@ gst_v4l2_tuner_get_norm (GstV4l2Object * v4l2object)
   gst_v4l2_get_norm (v4l2object, &norm);
 
   for (item = v4l2object->norms; item != NULL; item = item->next) {
-    if (norm == GST_V4L2_TUNER_NORM (item->data)->index)
+    if (norm & GST_V4L2_TUNER_NORM (item->data)->index)
       return (GstTunerNorm *) item->data;
   }