registry: maintain the typefind extension list order
authorStefan Kost <ensonic@users.sf.net>
Wed, 8 Dec 2010 09:52:31 +0000 (11:52 +0200)
committerStefan Kost <ensonic@users.sf.net>
Wed, 8 Dec 2010 09:53:10 +0000 (11:53 +0200)
gst/gstregistrychunks.c

index b34dcfa..e308174 100644 (file)
@@ -656,9 +656,10 @@ gst_registry_chunks_load_feature (GstRegistry * registry, gchar ** in,
       GST_DEBUG ("Reading %d Typefind extensions at address %p",
           tff->nextensions, *in);
       factory->extensions = g_new0 (gchar *, tff->nextensions + 1);
-      for (i = 0; i < tff->nextensions; i++) {
+      /* unpack in reverse order to maintain the correct order */
+      for (i = tff->nextensions; i > 0; i--) {
         unpack_string (*in, str, end, fail);
-        factory->extensions[i] = str;
+        factory->extensions[i - 1] = str;
       }
     }
   } else if (GST_IS_INDEX_FACTORY (feature)) {