2008-04-20 Sebastian Dröge <slomo@circular-chaos.org>
+ * ext/gnomevfs/gstgnomevfssink.c:
+ (gst_gnome_vfs_sink_uri_get_protocols):
+ * ext/gnomevfs/gstgnomevfssrc.c:
+ (gst_gnome_vfs_src_uri_get_protocols):
+ * ext/gnomevfs/gstgnomevfsuri.c: (_internal_get_supported_uris),
+ (gst_gnomevfs_get_supported_uris):
+ Get the list of supported URI schemes in a threadsafe way and use the
+ same list for the source and sink.
+
+2008-04-20 Sebastian Dröge <slomo@circular-chaos.org>
+
* ext/gio/gstgio.c: (_internal_get_supported_protocols),
(gst_gio_get_supported_protocols):
Don't generate a new supported protocols list on each call but cache
static gchar **
gst_gnome_vfs_sink_uri_get_protocols (void)
{
- static gchar **protocols = NULL;
-
- if (!protocols)
- protocols = gst_gnomevfs_get_supported_uris ();
-
- return protocols;
+ return gst_gnomevfs_get_supported_uris ();
}
static const gchar *
static gchar **
gst_gnome_vfs_src_uri_get_protocols (void)
{
- static gchar **protocols = NULL;
-
- if (!protocols)
- protocols = gst_gnomevfs_get_supported_uris ();
-
- return protocols;
+ return gst_gnomevfs_get_supported_uris ();
}
static const gchar *
#include <gst/gst.h>
-gchar **
-gst_gnomevfs_get_supported_uris (void)
+static gpointer
+_internal_get_supported_uris (gpointer data)
{
/* no dav/davs in the list, because they don't appear to be reliable enough */
const gchar *uris[] = {
return result;
}
+
+gchar **
+gst_gnomevfs_get_supported_uris (void)
+{
+ static GOnce once = G_ONCE_INIT;
+
+ g_once (&once, _internal_get_supported_uris, NULL);
+ return (gchar **) once.retval;
+}