From b2b1a7be1ba877f1f64fed7ff920855bb38becf1 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Sat, 18 Jun 2011 11:16:19 +0200 Subject: [PATCH] discoverer: Allow GError* argument to be NULL This is how other methods taking GError* arguments behave. Fixes #652838 --- gst-libs/gst/pbutils/gstdiscoverer.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/gst-libs/gst/pbutils/gstdiscoverer.c b/gst-libs/gst/pbutils/gstdiscoverer.c index 6eda250..c41acee 100644 --- a/gst-libs/gst/pbutils/gstdiscoverer.c +++ b/gst-libs/gst/pbutils/gstdiscoverer.c @@ -1441,7 +1441,7 @@ gst_discoverer_discover_uri_async (GstDiscoverer * discoverer, * gst_discoverer_discover_uri: * @discoverer: A #GstDiscoverer * @uri: The URI to run on. - * @err: If an error occurred, this field will be filled in. + * @err: (out) (allow-none): If an error occurred, this field will be filled in. * * Synchronously discovers the given @uri. * @@ -1477,10 +1477,12 @@ gst_discoverer_discover_uri (GstDiscoverer * discoverer, const gchar * uri, discoverer_collect (discoverer); /* Get results */ - if (discoverer->priv->current_error) - *err = g_error_copy (discoverer->priv->current_error); - else - *err = NULL; + if (err) { + if (discoverer->priv->current_error) + *err = g_error_copy (discoverer->priv->current_error); + else + *err = NULL; + } if (res != GST_DISCOVERER_OK) { GST_DEBUG ("Setting result to %d (was %d)", res, discoverer->priv->current_info->result); -- 2.7.4