From 3a6b921f630b9aaae56ccdac8c7d7aceafc031d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Sun, 3 Sep 2006 11:06:52 +0000 Subject: [PATCH] gst/gstregistryxml.c: Print a warning rather than g_assert() if a plugin feature is a URI handler but returns no prot... 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 | 6 ++++++ gst/gstregistryxml.c | 22 +++++++++++++--------- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 48423d6640..28a3992d71 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-09-03 Tim-Philipp Müller + + * 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 * docs/random/moving-plugins: diff --git a/gst/gstregistryxml.c b/gst/gstregistryxml.c index d313dadcfa..2e5a154c62 100644 --- a/gst/gstregistryxml.c +++ b/gst/gstregistryxml.c @@ -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)) {