typefind: Stop typefinding if we get a CAPS event from upstream
authorSebastian Dröge <sebastian.droege@collabora.co.uk>
Mon, 29 Apr 2013 10:54:27 +0000 (12:54 +0200)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Mon, 29 Apr 2013 11:24:56 +0000 (13:24 +0200)
plugins/elements/gsttypefindelement.c

index 31e4127..3f88750 100644 (file)
@@ -719,34 +719,13 @@ gst_type_find_element_setcaps (GstTypeFindElement * typefind, GstCaps * caps)
 
   /* Shortcircuit typefinding if we get caps */
   if (typefind->mode == MODE_TYPEFIND) {
-    GstBuffer *buffer;
-    gsize avail;
-
     GST_DEBUG_OBJECT (typefind, "Skipping typefinding, using caps from "
         "upstream: %" GST_PTR_FORMAT, caps);
-    typefind->mode = MODE_NORMAL;
-
-    gst_type_find_element_send_cached_events (typefind);
-    GST_OBJECT_LOCK (typefind);
-    avail = gst_adapter_available (typefind->adapter);
-    if (avail == 0)
-      goto no_data;
 
-    buffer = gst_adapter_take_buffer (typefind->adapter, avail);
-    GST_OBJECT_UNLOCK (typefind);
-
-    GST_DEBUG_OBJECT (typefind, "Pushing buffer: %" G_GSIZE_FORMAT, avail);
-    gst_pad_push (typefind->src, buffer);
+    stop_typefinding (typefind);
   }
 
   return TRUE;
-
-no_data:
-  {
-    GST_DEBUG_OBJECT (typefind, "no data to push");
-    GST_OBJECT_UNLOCK (typefind);
-    return TRUE;
-  }
 }
 
 static gchar *