basesrc: don't try to answer URI queries with NULL URIs
authorTim-Philipp Müller <tim.muller@collabora.co.uk>
Mon, 6 Aug 2012 19:04:09 +0000 (20:04 +0100)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Mon, 6 Aug 2012 19:04:09 +0000 (20:04 +0100)
Should make unit tests in -base that use appsrc a bit happier.

libs/gst/base/gstbasesrc.c

index 1358321..8714ab9 100644 (file)
@@ -1206,9 +1206,13 @@ gst_base_src_default_query (GstBaseSrc * src, GstQuery * query)
       if (GST_IS_URI_HANDLER (src)) {
         gchar *uri = gst_uri_handler_get_uri (GST_URI_HANDLER (src));
 
-        gst_query_set_uri (query, uri);
-        g_free (uri);
-        res = TRUE;
+        if (uri != NULL) {
+          gst_query_set_uri (query, uri);
+          g_free (uri);
+          res = TRUE;
+        } else {
+          res = FALSE;
+        }
       } else {
         res = FALSE;
       }