gst/gstregistryxml.c: Print a warning rather than g_assert() if a plugin feature...
authorTim-Philipp Müller <tim@centricular.net>
Sun, 3 Sep 2006 11:06:52 +0000 (11:06 +0000)
committerTim-Philipp Müller <tim@centricular.net>
Sun, 3 Sep 2006 11:06:52 +0000 (11:06 +0000)
Original commit message from CVS:
* gst/gstregistryxml.c: (gst_registry_xml_save_feature):
Print a warning rather than g_assert() if a plugin feature
is a URI handler but returns no protocols (#353976).

ChangeLog
gst/gstregistryxml.c

index 48423d6..28a3992 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-09-03  Tim-Philipp Müller  <tim at centricular dot net>
+
+       * gst/gstregistryxml.c: (gst_registry_xml_save_feature):
+         Print a warning rather than g_assert() if a plugin feature
+         is a URI handler but returns no protocols (#353976).
+
 2006-09-02  Stefan Kost  <ensonic@users.sf.net>
 
        * docs/random/moving-plugins:
index d313dad..2e5a154 100644 (file)
@@ -717,18 +717,22 @@ gst_registry_xml_save_feature (GstRegistry * registry,
     }
 
     if (GST_URI_TYPE_IS_VALID (factory->uri_type)) {
-      gchar **protocol;
-
       if (!gst_registry_save_escaped (registry, "  ", "uri_type",
               factory->uri_type == GST_URI_SINK ? "sink" : "source"))
         return FALSE;
-      g_assert (factory->uri_protocols);
-      protocol = factory->uri_protocols;
-      while (*protocol) {
-        if (!gst_registry_save_escaped (registry, "  ", "uri_protocol",
-                *protocol))
-          return FALSE;
-        protocol++;
+      if (factory->uri_protocols) {
+        gchar **protocol;
+
+        protocol = factory->uri_protocols;
+        while (*protocol) {
+          if (!gst_registry_save_escaped (registry, "  ", "uri_protocol",
+                  *protocol))
+            return FALSE;
+          protocol++;
+        }
+      } else {
+        g_warning ("GStreamer feature '%s' is URI handler but does not provide"
+            " any protocols it can handle", feature->name);
       }
     }
   } else if (GST_IS_TYPE_FIND_FACTORY (feature)) {