diff --git a/gst/playback/gstdecodebin2.c b/gst/playback/gstdecodebin2.c
index 0255fd2..46f0f99 100644
--- a/gst/playback/gstdecodebin2.c
+++ b/gst/playback/gstdecodebin2.c
@@ -2944,7 +2944,15 @@ sort_end_pads (GstDecodePad * da, GstDecodePad * db)
   gst_caps_unref (capsa);
   gst_caps_unref (capsb);
 
-  return va - vb;
+  if (va == vb) {
+    /* compare chain srcpad names to end up with deterministic pad order */
+    GST_DEBUG_OBJECT (da->chain->pad, "1: %s",  GST_PAD_NAME (da));
+    GST_DEBUG_OBJECT (db->chain->pad, "2: %s",  GST_PAD_NAME (db));
+    return strcmp (GST_PAD_NAME (da->chain->pad), GST_PAD_NAME (db->chain->pad));
+  }
+  else {
+    return va - vb;
+  }
 }
 
 static GstCaps *
@@ -3155,6 +3163,7 @@ gst_decode_bin_expose (GstDecodeBin * dbin)
   }
 
   /* re-order pads : video, then audio, then others */
+  GST_DEBUG_OBJECT (dbin, "sorting %d endpads", g_list_length (endpads));
   endpads = g_list_sort (endpads, (GCompareFunc) sort_end_pads);
 
   /* Expose pads */
