diff --git a/gst/playback/gstplaybin2.c b/gst/playback/gstplaybin2.c
index 12d72eb..723aef6 100644
--- a/gst/playback/gstplaybin2.c
+++ b/gst/playback/gstplaybin2.c
@@ -3047,6 +3047,25 @@ group_set_locked_state_unlocked (GstPlayBin * playbin, GstSourceGroup * group,
   return TRUE;
 }
 
+static GstCaps *
+_get_first_sink_caps (GstElement * element)
+{
+  GstIterator *it;
+  GstPad *pad;
+  GstCaps *caps;
+
+  it = gst_element_iterate_sink_pads (element);
+
+  if ((gst_iterator_next (it, (gpointer) & pad)) == GST_ITERATOR_OK) {
+    caps = gst_pad_get_caps (pad);
+    gst_object_unref (GST_OBJECT (pad));
+  } else
+    caps = gst_caps_new_empty ();
+
+  gst_iterator_free (it);
+  return caps;
+}
+
 /* must be called with PLAY_BIN_LOCK */
 static gboolean
 activate_group (GstPlayBin * playbin, GstSourceGroup * group, GstState target)
@@ -3054,6 +3073,8 @@ activate_group (GstPlayBin * playbin, GstSourceGroup * group, GstState target)
   GstElement *uridecodebin;
   GstElement *suburidecodebin = NULL;
   GstPlayFlags flags;
+  gint i;
+  GstCaps *caps, *sinkcaps;
 
   g_return_val_if_fail (group->valid, FALSE);
   g_return_val_if_fail (!group->active, FALSE);
@@ -3107,6 +3128,34 @@ activate_group (GstPlayBin * playbin, GstSourceGroup * group, GstState target)
   g_object_set (uridecodebin, "ring-buffer-max-size",
       playbin->ring_buffer_max_size, NULL);
 
+  /* configure stop-caps */
+  g_object_get (uridecodebin, "caps", &caps, NULL);
+  caps = gst_caps_make_writable (caps);
+  i = gst_caps_get_size (caps);
+  for (; i > 0; i--) {
+    GstStructure *st;
+
+    st = gst_caps_get_structure (caps, i - 1);
+    if ((playbin->audio_sink &&
+            g_str_has_prefix (gst_structure_get_name (st), "audio/")) ||
+        (playbin->video_sink &&
+            g_str_has_prefix (gst_structure_get_name (st), "video/")))
+      gst_caps_remove_structure (caps, i - 1);
+  }
+  if (playbin->audio_sink)
+    sinkcaps = _get_first_sink_caps (playbin->audio_sink);
+  else if (playbin->video_sink)
+    sinkcaps = _get_first_sink_caps (playbin->video_sink);
+  else
+    sinkcaps = gst_caps_new_empty ();
+  if (!gst_caps_is_empty (sinkcaps))
+    gst_caps_merge (caps, sinkcaps);
+  else
+    gst_caps_unref (sinkcaps);
+  GST_DEBUG_OBJECT (uridecodebin, "set the caps:%" GST_PTR_FORMAT, caps);
+  g_object_set (uridecodebin, "caps", caps, NULL);
+  gst_caps_unref (caps);
+
   /* connect pads and other things */
   group->pad_added_id = g_signal_connect (uridecodebin, "pad-added",
       G_CALLBACK (pad_added_cb), group);
