Index: gsttypefindelement.c
===================================================================
RCS file: /cvs/gstreamer/gstreamer/plugins/elements/gsttypefindelement.c,v
retrieving revision 1.73
diff -u -r1.73 gsttypefindelement.c
--- gsttypefindelement.c	24 Mar 2006 10:38:20 -0000	1.73
+++ gsttypefindelement.c	24 Mar 2006 15:29:16 -0000
@@ -518,6 +518,31 @@
 
   typefind = GST_TYPE_FIND_ELEMENT (GST_PAD_PARENT (pad));
 
+  /* Shortcircuit typefinding if we already have non-any caps */
+  if (typefind->mode == MODE_TYPEFIND)
+  {
+    GstCaps *caps = gst_buffer_get_caps (buffer);
+    
+    if (caps) {
+      if (gst_caps_is_any (caps)) {
+        gst_caps_unref (caps);
+      }
+      else {
+        typefind->mode = MODE_NORMAL;
+        g_signal_emit (typefind, gst_type_find_element_signals[HAVE_TYPE], 0,
+            TYPE_FIND_MAX_SIZE, caps);
+
+        if (typefind->store) {
+          GST_DEBUG_OBJECT (typefind, "Pushing store: %d", 
+                  GST_BUFFER_SIZE (typefind->store));
+          gst_buffer_set_caps (typefind->store, typefind->caps);
+          gst_pad_push (typefind->src, typefind->store);
+          typefind->store = NULL;
+        }
+      }
+    }
+  }
+
   switch (typefind->mode) {
     case MODE_ERROR:
       /* we should already have called GST_ELEMENT_ERROR */
