[0.11] gstreamer: basesrc: handle NULL from getcaps

Wim Taymans wtay at kemper.freedesktop.org
Thu Jan 19 06:18:36 PST 2012


Module: gstreamer
Branch: 0.11
Commit: c6ac51e72980acf6c9c232e0911f642f0c2031aa
URL:    http://cgit.freedesktop.org/gstreamer/gstreamer/commit/?id=c6ac51e72980acf6c9c232e0911f642f0c2031aa

Author: Wim Taymans <wim.taymans at collabora.co.uk>
Date:   Thu Jan 19 15:17:58 2012 +0100

basesrc: handle NULL from getcaps

If the getcaps functions returns NULL, return FALSE from the CAPS query.

---

 libs/gst/base/gstbasesrc.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/libs/gst/base/gstbasesrc.c b/libs/gst/base/gstbasesrc.c
index bc37bf1..a127f4e 100644
--- a/libs/gst/base/gstbasesrc.c
+++ b/libs/gst/base/gstbasesrc.c
@@ -1178,10 +1178,13 @@ gst_base_src_default_query (GstBaseSrc * src, GstQuery * query)
       bclass = GST_BASE_SRC_GET_CLASS (src);
       if (bclass->get_caps) {
         gst_query_parse_caps (query, &filter);
-        caps = bclass->get_caps (src, filter);
-        gst_query_set_caps_result (query, caps);
-        gst_caps_unref (caps);
-        res = TRUE;
+        if ((caps = bclass->get_caps (src, filter))) {
+          gst_query_set_caps_result (query, caps);
+          gst_caps_unref (caps);
+          res = TRUE;
+        } else {
+          res = FALSE;
+        }
       } else
         res = FALSE;
       break;



More information about the gstreamer-commits mailing list