parsebin: maintain original order when creating fallback stream collection
authorTim-Philipp Müller <tim@centricular.com>
Sat, 26 Dec 2015 13:19:01 +0000 (13:19 +0000)
committerTim-Philipp Müller <tim@centricular.com>
Tue, 26 Jul 2016 14:23:15 +0000 (15:23 +0100)
gst/playback/gstparsebin.c

index 6eb0a84..72d7ba6 100644 (file)
@@ -3750,7 +3750,10 @@ build_fallback_collection (GstParseChain * chain,
 
   if (!group)
     return;
-  for (l = group->children; l; l = l->next) {
+
+  /* we used g_list_prepend when adding children, so iterate from last
+   * to first to maintain the original order they were added in */
+  for (l = g_list_last (group->children); l != NULL; l = l->prev) {
     GstParseChain *childchain = l->data;
 
     build_fallback_collection (childchain, collection);