typefind: Send caps again after activation
authorEdward Hervey <edward.hervey@collabora.co.uk>
Fri, 6 Jan 2012 15:39:04 +0000 (16:39 +0100)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Tue, 10 Jan 2012 11:58:59 +0000 (12:58 +0100)
Avoids ending up in cases where typefind gets activated in pull-mode
and caps never get sent.

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

plugins/elements/gsttypefindelement.c

index ac942b4..1f7e03a 100644 (file)
@@ -883,6 +883,14 @@ gst_type_find_element_activate_src_mode (GstPad * pad, GstObject * parent,
   switch (mode) {
     case GST_PAD_MODE_PULL:
       res = gst_pad_activate_mode (typefind->sink, mode, active);
+      if (typefind->caps) {
+        GstCaps *caps;
+        GST_OBJECT_LOCK (typefind);
+        caps = gst_caps_ref (typefind->caps);
+        GST_OBJECT_UNLOCK (typefind);
+        gst_pad_push_event (typefind->src, gst_event_new_caps (caps));
+        gst_caps_unref (caps);
+      }
       break;
     default:
       res = TRUE;