diff --git a/gst/playback/gstdecodebin2.c b/gst/playback/gstdecodebin2.c
index 17f19f8..3ae95cd 100644
--- a/gst/playback/gstdecodebin2.c
+++ b/gst/playback/gstdecodebin2.c
@@ -1455,24 +1455,56 @@ analyze_new_pad (GstDecodeBin * dbin, GstElement * src, GstPad * pad,
   if (factories == NULL)
     goto expose_pad;
 
+  /* Don't try plug twice a factory in a chain filtering the factory list */
+  if (factories->n_values > 0) {
+    guint i = 0;
+    const GList *l;
+    while (i < factories->n_values) {
+      GstElementFactory *factory =
+          g_value_get_object (g_value_array_get_nth (factories, i));
+      gboolean remove = FALSE;
+      CHAIN_MUTEX_LOCK (chain);
+      for (l = chain->elements; l; l = l->next) {
+        GstDecodeElement *delem = (GstDecodeElement *) l->data;
+        GstElement *otherelement = delem->element;
+
+        if (gst_element_get_factory (otherelement) == factory) {
+          remove = TRUE;
+          break;
+        }
+      }
+      CHAIN_MUTEX_UNLOCK (chain);
+      if (remove) {
+        GST_DEBUG_OBJECT (dbin,
+            "remove factory '%s' because it was already used in this chain",
+            gst_plugin_feature_get_name (GST_PLUGIN_FEATURE_CAST (factory)));
+        g_value_array_remove (factories, i);
+      } else {
+        i++;
+      }
+    }
+  }
   /* if the array is empty, we have a type for which we have no decoder */
   if (factories->n_values == 0) {
+    g_value_array_free (factories);
+    gst_object_unref (dpad);
+
     if (!dbin->expose_allstreams) {
       GstCaps *raw = gst_static_caps_get (&default_raw_caps);
+      gboolean is_raw = gst_caps_can_intersect (raw, caps);
+      gst_caps_unref (raw);
 
       /* If the caps are raw, this just means we don't want to expose them */
-      if (gst_caps_can_intersect (raw, caps)) {
-        g_value_array_free (factories);
-        gst_caps_unref (raw);
-        gst_object_unref (dpad);
+      if (is_raw) {
         goto discarded_type;
       }
-      gst_caps_unref (raw);
+    }
+
+    if (!gst_caps_is_fixed (caps)) {
+      goto discarded_type;
     }
 
     /* if not we have a unhandled type with no compatible factories */
-    g_value_array_free (factories);
-    gst_object_unref (dpad);
     goto unknown_type;
   }
 
@@ -1780,38 +1812,6 @@ connect_pad (GstDecodeBin * dbin, GstElement * src, GstDecodePad * dpad,
     /* Remove selected factory from the list. */
     g_value_array_remove (factories, 0);
 
-    /* If the factory is for a parser we first check if the factory
-     * was already used for the current chain. If it was used already
-     * we would otherwise create an infinite loop here because the
-     * parser apparently accepts its own output as input.
-     * This is only done for parsers because it's perfectly valid
-     * to have other element classes after each other because a
-     * parser is the only one that does not change the data. A
-     * valid example for this would be multiple id3demux in a row.
-     */
-    if (strstr (gst_element_factory_get_klass (factory), "Parser")) {
-      gboolean skip = FALSE;
-      GList *l;
-
-      CHAIN_MUTEX_LOCK (chain);
-      for (l = chain->elements; l; l = l->next) {
-        GstDecodeElement *delem = (GstDecodeElement *) l->data;
-        GstElement *otherelement = delem->element;
-
-        if (gst_element_get_factory (otherelement) == factory) {
-          skip = TRUE;
-          break;
-        }
-      }
-      CHAIN_MUTEX_UNLOCK (chain);
-      if (skip) {
-        GST_DEBUG_OBJECT (dbin,
-            "Skipping factory '%s' because it was already used in this chain",
-            gst_plugin_feature_get_name (GST_PLUGIN_FEATURE_CAST (factory)));
-        continue;
-      }
-    }
-
     /* emit autoplug-select to see what we should do with it. */
     g_signal_emit (G_OBJECT (dbin),
         gst_decode_bin_signals[SIGNAL_AUTOPLUG_SELECT],
