adder: fix getcaps function
authorWim Taymans <wim.taymans@collabora.co.uk>
Sun, 8 May 2011 11:24:30 +0000 (13:24 +0200)
committerWim Taymans <wim.taymans@collabora.co.uk>
Sun, 8 May 2011 11:24:30 +0000 (13:24 +0200)
Explicitely get the possible caps in the sinkpad instead of using an old removed
function.

gst/adder/gstadder.c

index 20ab8cf..5aced2c 100644 (file)
@@ -174,9 +174,16 @@ gst_adder_sink_getcaps (GstPad * pad)
   /* get the downstream possible caps */
   peercaps = gst_pad_peer_get_caps (adder->srcpad);
 
-  /* get the allowed caps on this sinkpad, we use the fixed caps function so
-   * that it does not call recursively in this function. */
-  sinkcaps = gst_pad_get_fixed_caps_func (pad);
+  /* get the allowed caps on this sinkpad */
+  sinkcaps = gst_pad_get_current_caps (pad);
+  if (sinkcaps == NULL) {
+    sinkcaps = (GstCaps *) gst_pad_get_pad_template_caps (pad);
+    if (sinkcaps)
+      gst_caps_ref (sinkcaps);
+    else
+      sinkcaps = gst_caps_new_any ();
+  }
+
   if (peercaps) {
     /* restrict with filter-caps if any */
     if (filter_caps) {