diff --git a/gst/playback/gstdecodebin2.c b/gst/playback/gstdecodebin2.c
index 3b60ae9..c66bd3c 100644
--- a/gst/playback/gstdecodebin2.c
+++ b/gst/playback/gstdecodebin2.c
@@ -280,6 +280,8 @@ struct _GstDecodeGroup
 
 static GstDecodeGroup *gst_decode_group_new (GstDecodeBin * decode_bin,
     gboolean use_queue);
+static void gst_decode_group_add_multiqueue (GstDecodeBin * dbin,
+    GstDecodeGroup * group);
 static GstPad *gst_decode_group_control_demuxer_pad (GstDecodeGroup * group,
     GstPad * pad);
 static gboolean gst_decode_group_control_source_pad (GstDecodeGroup * group,
@@ -1185,6 +1187,7 @@ connect_pad (GstDecodeBin * dbin, GstElement * src, GstDecodePad * dpad,
 {
   gboolean res = FALSE;
   GstPad *mqpad = NULL;
+  gboolean demuxer_element = is_demuxer_element (src);
 
   g_return_val_if_fail (factories != NULL, FALSE);
   g_return_val_if_fail (factories->n_values > 0, FALSE);
@@ -1192,13 +1195,14 @@ connect_pad (GstDecodeBin * dbin, GstElement * src, GstDecodePad * dpad,
   GST_DEBUG_OBJECT (dbin, "pad %s:%s , group:%p",
       GST_DEBUG_PAD_NAME (pad), group);
 
+  if (!group)
+    group = get_current_group (dbin, TRUE, demuxer_element, NULL);
+
   /* 1. is element demuxer or parser */
-  if (is_demuxer_element (src)) {
+  if (demuxer_element) {
     GST_LOG_OBJECT (src, "is a demuxer, connecting the pad through multiqueue");
 
-    if (!group)
-      group = get_current_group (dbin, TRUE, TRUE, NULL);
-
+    gst_decode_group_add_multiqueue (dbin, group);
     gst_ghost_pad_set_target (GST_GHOST_PAD (dpad), NULL);
     if (!(mqpad = gst_decode_group_control_demuxer_pad (group, pad)))
       goto beach;
@@ -1476,6 +1480,7 @@ expose_pad (GstDecodeBin * dbin, GstElement * src, GstDecodePad * dpad,
   if (isdemux) {
     GST_LOG_OBJECT (src, "connecting the pad through multiqueue");
 
+    gst_decode_group_add_multiqueue (dbin, group);
     gst_ghost_pad_set_target (GST_GHOST_PAD (dpad), NULL);
     if (!(mqpad = gst_decode_group_control_demuxer_pad (group, pad)))
       goto beach;
@@ -1785,6 +1790,35 @@ multi_queue_overrun_cb (GstElement * queue, GstDecodeGroup * group)
   }
 }
 
+static void
+gst_decode_group_add_multiqueue (GstDecodeBin * dbin, GstDecodeGroup * group)
+{
+  GstElement *mq = NULL;
+
+  if (group->multiqueue)
+    return;
+
+  if (!(mq = gst_element_factory_make ("multiqueue", NULL))) {
+    GST_ERROR_OBJECT (dbin, "Couldn't create multiqueue element");
+    return;
+  }
+
+  /* we first configure the multiqueue to buffer an unlimited number of
+   * buffers up to 5 seconds or, when no timestamps are present, up to 2 MB of
+   * memory. When this queue overruns, we assume the group is complete and can
+   * be exposed. */
+  g_object_set (G_OBJECT (mq),
+      "max-size-bytes", (guint) 2 * 1024 * 1024,
+      "max-size-time", (guint64) 0, "max-size-buffers", (guint) 0, NULL);
+  /* will expose the group */
+  group->overrunsig = g_signal_connect (G_OBJECT (mq), "overrun",
+      G_CALLBACK (multi_queue_overrun_cb), group);
+
+  gst_bin_add (GST_BIN (dbin), mq);
+  gst_element_set_state (mq, GST_STATE_PAUSED);
+  group->multiqueue = mq;
+}
+
 /* gst_decode_group_new:
  *
  * Creates a new GstDecodeGroup. It is up to the caller to add it to the list
@@ -1794,23 +1828,12 @@ static GstDecodeGroup *
 gst_decode_group_new (GstDecodeBin * dbin, gboolean use_queue)
 {
   GstDecodeGroup *group;
-  GstElement *mq;
 
   GST_LOG_OBJECT (dbin, "Creating new group");
 
-  if (use_queue) {
-    if (!(mq = gst_element_factory_make ("multiqueue", NULL))) {
-      GST_ERROR_OBJECT (dbin, "Couldn't create multiqueue element");
-      return NULL;
-    }
-  } else {
-    mq = NULL;
-  }
-
   group = g_new0 (GstDecodeGroup, 1);
   group->lock = g_mutex_new ();
   group->dbin = dbin;
-  group->multiqueue = mq;
   group->exposed = FALSE;
   group->drained = FALSE;
   group->blocked = FALSE;
@@ -1818,21 +1841,8 @@ gst_decode_group_new (GstDecodeBin * dbin, gboolean use_queue)
   group->endpads = NULL;
   group->reqpads = NULL;
 
-  if (mq) {
-    /* we first configure the multiqueue to buffer an unlimited number of
-     * buffers up to 5 seconds or, when no timestamps are present, up to 2 MB of
-     * memory. When this queue overruns, we assume the group is complete and can
-     * be exposed. */
-    g_object_set (G_OBJECT (mq),
-        "max-size-bytes", (guint) 2 * 1024 * 1024,
-        "max-size-time", (guint64) 0, "max-size-buffers", (guint) 0, NULL);
-    /* will expose the group */
-    group->overrunsig = g_signal_connect (G_OBJECT (mq), "overrun",
-        G_CALLBACK (multi_queue_overrun_cb), group);
-
-    gst_bin_add (GST_BIN (dbin), mq);
-    gst_element_set_state (mq, GST_STATE_PAUSED);
-  }
+  if (use_queue)
+    gst_decode_group_add_multiqueue (dbin, group);
 
   GST_LOG_OBJECT (dbin, "Returning new group %p", group);
 
@@ -2206,6 +2216,11 @@ gst_decode_group_expose (GstDecodeGroup * group)
 
   GST_LOG_OBJECT (dbin, "Exposing group %p", group);
 
+  if (!group->endpads) {
+    GST_ELEMENT_ERROR (dbin, CORE, MISSING_PLUGIN, (NULL), (NULL));
+    return FALSE;
+  }
+
   /* re-order pads : video, then audio, then others */
   group->endpads = g_list_sort (group->endpads, (GCompareFunc) sort_end_pads);
 
