ext/gnomevfs/: Get the list of supported URI schemes in a threadsafe way and use the same list for the source and sink.

Original commit message from CVS:
* 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.
This commit is contained in:
Sebastian Dröge 2008-04-20 10:17:23 +00:00
parent 9f83e90909
commit fb2dc81a97
4 changed files with 24 additions and 14 deletions

View file

@ -1,3 +1,14 @@
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),

View file

@ -596,12 +596,7 @@ gst_gnome_vfs_sink_uri_get_type (void)
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 *

View file

@ -350,12 +350,7 @@ gst_gnome_vfs_src_uri_get_type (void)
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 *

View file

@ -32,8 +32,8 @@
#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[] = {
@ -76,3 +76,12 @@ gst_gnomevfs_get_supported_uris (void)
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;
}