make the registry read the plugin feature's rank - this should even make the autoplug...
authorBenjamin Otte <otte@gnome.org>
Sat, 27 Sep 2003 18:51:16 +0000 (18:51 +0000)
committerBenjamin Otte <otte@gnome.org>
Sat, 27 Sep 2003 18:51:16 +0000 (18:51 +0000)
Original commit message from CVS:
make the registry read the plugin feature's rank - this should even make the autoplugger work again. Did I mention I'm annoyed because someone didn't test his rank-removing patch? Once opening gst-player or rhythmbox with it would have shown that it doesn't work anymore...

gst/registries/gstxmlregistry.c

index c23a57a..36aea6f 100644 (file)
@@ -668,30 +668,46 @@ gst_xml_registry_parse_element_factory (GMarkupParseContext *context, const gcha
   GstElementFactory *factory = GST_ELEMENT_FACTORY (registry->current_feature);
 
   if (!strcmp (tag, "name")) {
+    g_free (registry->current_feature->name);
     registry->current_feature->name = g_strndup (text, text_len);
   }
   else if (!strcmp (tag, "longname")) {
+    g_free (factory->details->longname);
     factory->details->longname = g_strndup (text, text_len);
   }
   else if (!strcmp(tag, "class")) {
+    g_free (factory->details->klass);
     factory->details->klass = g_strndup (text, text_len);
   }
   else if (!strcmp(tag, "description")) {
+    g_free (factory->details->description);
     factory->details->description = g_strndup (text, text_len);
   }
   else if (!strcmp(tag, "license")) {
+    g_free (factory->details->license);
     factory->details->license = g_strndup (text, text_len);
   }
   else if (!strcmp(tag, "version")) {
+    g_free (factory->details->version);
     factory->details->version = g_strndup (text, text_len);
   }
   else if (!strcmp(tag, "author")) {
+    g_free (factory->details->author);
     factory->details->author = g_strndup (text, text_len);
   }
   else if (!strcmp(tag, "copyright")) {
+    g_free (factory->details->copyright);
     factory->details->copyright = g_strndup (text, text_len);
   }
-
+  else if (!strcmp(tag, "rank")) {
+    gint rank;
+    gchar *ret;
+     rank = strtol (text, &ret, 0);
+    if (ret == text + text_len) {
+     gst_element_factory_set_rank (factory, rank);
+    }
+  }
+  
   return TRUE;
 }