v4l2src: Don't assert when the interface is not implemented.
authorHavard Graff <havard.graff@tandberg.com>
Mon, 5 Sep 2011 08:43:19 +0000 (10:43 +0200)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Fri, 13 Jan 2012 10:07:20 +0000 (10:07 +0000)
Simply return FALSE instead.

https://bugzilla.gnome.org/show_bug.cgi?id=667817

sys/v4l2/gstv4l2src.c

index 023e77b..e2175a4 100644 (file)
@@ -95,14 +95,16 @@ gst_v4l2src_iface_supported (GstImplementsInterface * iface, GType iface_type)
   GstV4l2Object *v4l2object = GST_V4L2SRC (iface)->v4l2object;
 
 #ifdef HAVE_XVIDEO
-  g_assert (iface_type == GST_TYPE_TUNER ||
-      iface_type == GST_TYPE_X_OVERLAY ||
-      iface_type == GST_TYPE_COLOR_BALANCE ||
-      iface_type == GST_TYPE_VIDEO_ORIENTATION);
+  if (!(iface_type == GST_TYPE_TUNER ||
+        iface_type == GST_TYPE_X_OVERLAY ||
+        iface_type == GST_TYPE_COLOR_BALANCE ||
+        iface_type == GST_TYPE_VIDEO_ORIENTATION))
+    return FALSE;
 #else
-  g_assert (iface_type == GST_TYPE_TUNER ||
-      iface_type == GST_TYPE_COLOR_BALANCE ||
-      iface_type == GST_TYPE_VIDEO_ORIENTATION);
+  if (!(iface_type == GST_TYPE_TUNER ||
+        iface_type == GST_TYPE_COLOR_BALANCE ||
+        iface_type == GST_TYPE_VIDEO_ORIENTATION))
+    return FALSE;
 #endif
 
   if (v4l2object->video_fd == -1)