From 5be917d5bdfe3c0fdbfac70112e8241ea40f82a8 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 19 Jan 2012 15:18:58 +0100 Subject: [PATCH] appsrc: handle NULL caps correctly --- gst-libs/gst/app/gstappsrc.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/gst-libs/gst/app/gstappsrc.c b/gst-libs/gst/app/gstappsrc.c index b355ea2ad4..0b8012b5cc 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);