diff --git a/gst/playback/gstdecodebin2.c b/gst/playback/gstdecodebin2.c
index f07690e..4672615 100644
--- a/gst/playback/gstdecodebin2.c
+++ b/gst/playback/gstdecodebin2.c
@@ -1112,6 +1112,64 @@ setup_caps_delay:
   }
 }
 
+static gboolean
+is_demuxer_factory (GstElementFactory * factory)
+{
+  const GList *templates, *walk;
+  const gchar *klass;
+  gint potential_src_pads = 0;
+
+  klass = gst_element_factory_get_klass (factory);
+
+  /* Can't be a demuxer unless it has Demux in the klass name */
+  if (!strstr (klass, "Demux"))
+    return FALSE;
+
+  /* Walk the src pad templates and count how many the element
+   * might produce */
+  walk = templates = gst_element_factory_get_static_pad_templates (factory);
+  while (walk != NULL) {
+    GstStaticPadTemplate *templ;
+
+    templ = (GstStaticPadTemplate *) walk->data;
+    if (templ->direction == GST_PAD_SRC) {
+      switch (templ->presence) {
+        case GST_PAD_ALWAYS:
+        case GST_PAD_SOMETIMES:
+          if (strstr (templ->name_template, "%"))
+            potential_src_pads += 2;    /* Might make multiple pads */
+          else
+            potential_src_pads += 1;
+          break;
+        case GST_PAD_REQUEST:
+          potential_src_pads += 2;
+          break;
+      }
+    }
+    walk = walk->next;
+  }
+
+  if (potential_src_pads < 2)
+    return FALSE;
+
+  return TRUE;
+}
+
+static gboolean
+contains_demuxer_factory (GValueArray * factories)
+{
+  GstElementFactory *factory;
+  gint i;
+
+  for (i = 0; i < factories->n_values; i++) {
+    factory = g_value_get_object (g_value_array_get_nth (factories, i));
+
+    if (is_demuxer_factory (factory))
+      return TRUE;
+  }
+
+  return FALSE;
+}
 
 /* connect_pad:
  *
@@ -1130,6 +1188,7 @@ connect_pad (GstDecodeBin * dbin, GstElement * src, GstDecodePad * dpad,
 {
   gboolean res = FALSE;
   GstPad *mqpad = NULL;
+  gboolean have_demuxer_factories;
 
   g_return_val_if_fail (factories != NULL, FALSE);
   g_return_val_if_fail (factories->n_values > 0, FALSE);
@@ -1137,8 +1196,10 @@ connect_pad (GstDecodeBin * dbin, GstElement * src, GstDecodePad * dpad,
   GST_DEBUG_OBJECT (dbin, "pad %s:%s , group:%p",
       GST_DEBUG_PAD_NAME (pad), group);
 
+  have_demuxer_factories = contains_demuxer_factory (factories);
+
   /* 1. is element demuxer or parser */
-  if (is_demuxer_element (src)) {
+  if (is_demuxer_element (src) && !have_demuxer_factories) {
     GST_LOG_OBJECT (src, "is a demuxer, connecting the pad through multiqueue");
 
     if (!group)
@@ -1165,6 +1226,10 @@ connect_pad (GstDecodeBin * dbin, GstElement * src, GstDecodePad * dpad,
     /* Remove selected factory from the list. */
     g_value_array_remove (factories, 0);
 
+    /* If we have demuxer factories and this is not one of them ignore it */
+    if (have_demuxer_factories && !is_demuxer_factory (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],
