gstutils: Make gst_pad_proxy_getcaps() return empty caps if it's what the other side has
authorOlivier Crête <olivier.crete@collabora.co.uk>
Thu, 5 Aug 2010 00:06:57 +0000 (01:06 +0100)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Thu, 5 Aug 2010 00:14:18 +0000 (01:14 +0100)
gst_pad_proxy_getcaps() would return the pad template caps if the other side
returned empty caps or if the intersection of all the caps on the other side
was empty.

https://bugzilla.gnome.org/show_bug.cgi?id=624203

gst/gstutils.c

index 7b3ac98..70016b4 100644 (file)
@@ -2745,9 +2745,11 @@ gst_pad_proxy_getcaps (GstPad * pad)
       case GST_ITERATOR_DONE:
         /* all pads iterated, return collected value */
         goto done;
+      case GST_ITERATOR_OK:
+        /* premature exit (happens if caps intersection is empty) */
+        goto done;
       default:
-        /* iterator returned _ERROR or premature end with _OK,
-         * mark an error and exit */
+        /* iterator returned _ERROR, mark an error and exit */
         if ((caps = g_value_get_pointer (&ret)))
           gst_caps_unref (caps);
         g_value_set_pointer (&ret, NULL);