[0.11] gst-plugins-base: appsrc: handle NULL caps correctly

Wim Taymans wtay at kemper.freedesktop.org
Thu Jan 19 06:33:21 PST 2012


Module: gst-plugins-base
Branch: 0.11
Commit: 5be917d5bdfe3c0fdbfac70112e8241ea40f82a8
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-base/commit/?id=5be917d5bdfe3c0fdbfac70112e8241ea40f82a8

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

appsrc: handle NULL caps correctly

---

 gst-libs/gst/app/gstappsrc.c |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/gst-libs/gst/app/gstappsrc.c b/gst-libs/gst/app/gstappsrc.c
index b355ea2..0b8012b 100644
--- a/gst-libs/gst/app/gstappsrc.c
+++ b/gst-libs/gst/app/gstappsrc.c
@@ -1120,12 +1120,15 @@ gst_app_src_get_caps (GstAppSrc * appsrc, GstCaps * filter)
     gst_caps_ref (caps);
 
   if (filter) {
-    GstCaps *intersection =
-        gst_caps_intersect_full (filter, caps, GST_CAPS_INTERSECT_FIRST);
-    gst_caps_unref (caps);
-    caps = intersection;
+    if (caps) {
+      GstCaps *intersection =
+          gst_caps_intersect_full (filter, caps, GST_CAPS_INTERSECT_FIRST);
+      gst_caps_unref (caps);
+      caps = intersection;
+    } else {
+      caps = gst_caps_ref (filter);
+    }
   }
-
   GST_DEBUG_OBJECT (appsrc, "getting caps of %" GST_PTR_FORMAT, caps);
   GST_OBJECT_UNLOCK (appsrc);
 



More information about the gstreamer-commits mailing list