ghostpad: If we don't control a pad/template, return proper caps
authorEdward Hervey <edward.hervey@collabora.co.uk>
Mon, 10 Oct 2011 15:04:39 +0000 (17:04 +0200)
committerEdward Hervey <edward.hervey@collabora.co.uk>
Mon, 10 Oct 2011 15:04:39 +0000 (17:04 +0200)
If there's a filter, we can return that in _get_caps()

gst/gstghostpad.c

index f739988..4e8c8a8 100644 (file)
@@ -352,6 +352,12 @@ gst_proxy_pad_getcaps_default (GstPad * pad, GstCaps * filter)
       goto done;
     }
 
+    /* If there's a filter, return that */
+    if (filter != NULL) {
+      res = gst_caps_ref (filter);
+      goto done;
+    }
+
     /* last resort, any caps */
     GST_DEBUG_OBJECT (pad, "pad has no template, returning ANY");
     res = gst_caps_new_any ();