gst/gstregistrybinary.c: If an element supports the Uri interface, returns a valid...
authorSebastian Dröge <slomo@circular-chaos.org>
Wed, 16 Apr 2008 13:16:44 +0000 (13:16 +0000)
committerSebastian Dröge <slomo@circular-chaos.org>
Wed, 16 Apr 2008 13:16:44 +0000 (13:16 +0000)
Original commit message from CVS:
* gst/gstregistrybinary.c: (gst_registry_binary_save_feature),
(gst_registry_binary_load_feature),
(gst_registry_binary_load_plugin):
If an element supports the Uri interface, returns a valid pointer
to the supported URI protocols but this pointer contains nothing
don't try to save that as it will corrupt the registry.
Don't unref the plugin if we added it to the registry already but
fail to load a feature as gst_registry_add_plugin() takes ownership
of the plugin.
Improve debugging a bit.

ChangeLog
gst/gstregistrybinary.c

index e047c48..3c018ac 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2008-04-16  Sebastian Dröge  <slomo@circular-chaos.org>
+
+       * gst/gstregistrybinary.c: (gst_registry_binary_save_feature),
+       (gst_registry_binary_load_feature),
+       (gst_registry_binary_load_plugin):
+       If an element supports the Uri interface, returns a valid pointer
+       to the supported URI protocols but this pointer contains nothing
+       don't try to save that as it will corrupt the registry.
+
+       Don't unref the plugin if we added it to the registry already but
+       fail to load a feature as gst_registry_add_plugin() takes ownership
+       of the plugin.
+
+       Improve debugging a bit.
+
 2008-04-16  Stefan Kost  <ensonic@users.sf.net>
 
        * gst/gsttaglist.h:
index e7d09cb..aeecd29 100644 (file)
@@ -280,7 +280,7 @@ gst_registry_binary_save_feature (GList ** list, GstPluginFeature * feature)
     GST_DEBUG ("Saved %d Interfaces", ef->ninterfaces);
     /* save uritypes */
     if (GST_URI_TYPE_IS_VALID (factory->uri_type)) {
-      if (factory->uri_protocols) {
+      if (factory->uri_protocols && *factory->uri_protocols) {
         GstBinaryChunk *subchk;
         gchar **protocol;
 
@@ -681,8 +681,10 @@ gst_registry_binary_load_feature (GstRegistry * registry, gchar ** in,
   /* unpack plugin feature strings */
   unpack_string (*in, type_name);
 
-  if (!type_name || !*(type_name))
+  if (!type_name || !*(type_name)) {
+    GST_ERROR ("No feature type name");
     return FALSE;
+  }
 
   GST_DEBUG ("Plugin '%s' feature typename : '%s'", plugin_name, type_name);
 
@@ -858,6 +860,7 @@ gst_registry_binary_load_plugin (GstRegistry * registry, gchar ** in)
 
   plugin->basename = g_path_get_basename (plugin->filename);
 
+  /* Takes ownership of plugin */
   gst_registry_add_plugin (registry, plugin);
   GST_INFO ("Added plugin '%s' plugin with %d features from binary registry",
       plugin->desc.name, pe->nfeatures);
@@ -872,7 +875,6 @@ gst_registry_binary_load_plugin (GstRegistry * registry, gchar ** in)
 
   /* Errors */
 fail:
-  gst_object_unref (plugin);
   return FALSE;
 }