gst-plugins-good: v4l2src: Don' t assert when the interface is not implemented.

Tim Müller tpm at kemper.freedesktop.org
Fri Jan 13 02:10:52 PST 2012


Module: gst-plugins-good
Branch: master
Commit: 150403ab13dbccef653537cc62cc30a42f71d43f
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-good/commit/?id=150403ab13dbccef653537cc62cc30a42f71d43f

Author: Havard Graff <havard.graff at tandberg.com>
Date:   Mon Sep  5 10:43:19 2011 +0200

v4l2src: Don't assert when the interface is not implemented.

Simply return FALSE instead.

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

---

 sys/v4l2/gstv4l2src.c |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/sys/v4l2/gstv4l2src.c b/sys/v4l2/gstv4l2src.c
index 023e77b..e2175a4 100644
--- a/sys/v4l2/gstv4l2src.c
+++ b/sys/v4l2/gstv4l2src.c
@@ -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)



More information about the gstreamer-commits mailing list