Allow NULL to be a valid value for factory->extensions.
authorDavid Schleef <ds@schleef.org>
Wed, 29 Oct 2003 23:10:49 +0000 (23:10 +0000)
committerDavid Schleef <ds@schleef.org>
Wed, 29 Oct 2003 23:10:49 +0000 (23:10 +0000)
Original commit message from CVS:
Allow NULL to be a valid value for factory->extensions.

gst/gsttypefind.c
gst/registries/gstxmlregistry.c

index 77677d362add2a5db44484111764489ea4d06afa..b87d4fd70aaee724ff74432a4c7c09e686e324d9 100644 (file)
@@ -159,7 +159,8 @@ gst_type_find_factory_get_caps (const GstTypeFindFactory *factory)
  * 
  * Gets the extensions associated with a typefind factory. The returned
  * array should not be changed. If you need to change stuff in it, you should
- * copy it using g_stdupv().
+ * copy it using g_stdupv().  This function may return NULL to indicate
+ * a 0-length list.
  *
  * Returns: a NULL-terminated array of extensions associated with this factory
  */
index ca6b9f76da234bb0a8ff118902292b5e498200b0..3f5493fb62a9230432de318b890812df903c1da5 100644 (file)
@@ -1490,9 +1490,11 @@ gst_xml_registry_save_feature (GstXMLRegistry *xmlregistry, GstPluginFeature *fe
       gst_xml_registry_save_caps (xmlregistry, factory->caps);
       CLASS (xmlregistry)->save_func (xmlregistry, "</caps>\n");
     } */
-    while (factory->extensions[i]) {
-      PUT_ESCAPED ("extension", factory->extensions[i]);
-      i++;
+    if (factory->extensions) {
+      while (factory->extensions[i]) {
+        PUT_ESCAPED ("extension", factory->extensions[i]);
+        i++;
+      }
     }
   }
   else if (GST_IS_SCHEDULER_FACTORY (feature)) {