ext/gnomevfs/: Use _uri_new() instead of _open(), so it doesn't take as long and

Original commit message from CVS:
* ext/gnomevfs/gstgnomevfssink.c:
(gst_gnomevfssink_uri_get_protocols):
* ext/gnomevfs/gstgnomevfssrc.c:
(gst_gnomevfssrc_uri_get_protocols):
* ext/gnomevfs/gstgnomevfsuri.c: (gst_gnomevfs_get_supported_uris):
* ext/gnomevfs/gstgnomevfsuri.h:
Use _uri_new() instead of _open(), so it doesn't take as long and
Christophe's computer won't hang.
* gst/playback/gstplaybasebin.c: (unknown_type):
Throw error on unknown media type, so apps actually display it.
This commit is contained in:
Ronald S. Bultje 2004-09-15 06:33:44 +00:00
parent b42aadd2eb
commit 312cc7ec64
6 changed files with 23 additions and 12 deletions

View file

@ -1,3 +1,16 @@
2004-09-15 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* ext/gnomevfs/gstgnomevfssink.c:
(gst_gnomevfssink_uri_get_protocols):
* ext/gnomevfs/gstgnomevfssrc.c:
(gst_gnomevfssrc_uri_get_protocols):
* ext/gnomevfs/gstgnomevfsuri.c: (gst_gnomevfs_get_supported_uris):
* ext/gnomevfs/gstgnomevfsuri.h:
Use _uri_new() instead of _open(), so it doesn't take as long and
Christophe's computer won't hang.
* gst/playback/gstplaybasebin.c: (unknown_type):
Throw error on unknown media type, so apps actually display it.
2004-09-14 Brian Cameron <brian.cameron@sun.com
* tools/gst-launch-ext-m.m: Changed ~ to $ENV{HOME} to allow

View file

@ -264,7 +264,7 @@ gst_gnomevfssink_uri_get_protocols (void)
static gchar **protocols = NULL;
if (!protocols)
protocols = gst_gnomevfs_get_supported_uris (GNOME_VFS_OPEN_WRITE);
protocols = gst_gnomevfs_get_supported_uris ();
return protocols;
}

View file

@ -422,7 +422,7 @@ gst_gnomevfssrc_uri_get_protocols (void)
static gchar **protocols = NULL;
if (!protocols)
protocols = gst_gnomevfs_get_supported_uris (GNOME_VFS_OPEN_READ);
protocols = gst_gnomevfs_get_supported_uris ();
return protocols;
}

View file

@ -31,10 +31,9 @@
#include "gstgnomevfsuri.h"
gchar **
gst_gnomevfs_get_supported_uris (GnomeVFSOpenMode mode)
gst_gnomevfs_get_supported_uris (void)
{
GnomeVFSResult res;
GnomeVFSHandle *handle;
GnomeVFSURI *uri;
gchar *uris[] = {
"http://localhost/bla",
"file:///bla",
@ -50,15 +49,12 @@ gst_gnomevfs_get_supported_uris (GnomeVFSOpenMode mode)
result = g_new (gchar *, 9);
for (n = 0; uris[n] != NULL; n++) {
res = gnome_vfs_open (&handle, uris[n], mode);
if (res == GNOME_VFS_OK) {
gnome_vfs_close (handle);
}
/* FIXME: do something with mode error */
if (res != GNOME_VFS_ERROR_INVALID_URI) {
uri = gnome_vfs_uri_new (uris[n]);
if (uri != NULL) {
gchar *protocol = g_strdup (uris[n]);
gint n;
gnome_vfs_uri_unref (uri);
for (n = 0; protocol[n] != '\0'; n++) {
if (protocol[n] == ':') {
protocol[n] = '\0';

View file

@ -25,7 +25,7 @@
G_BEGIN_DECLS
gchar **gst_gnomevfs_get_supported_uris (GnomeVFSOpenMode mode);
gchar **gst_gnomevfs_get_supported_uris (void);
G_END_DECLS

View file

@ -254,6 +254,8 @@ unknown_type (GstElement * element, GstCaps * caps,
gchar *capsstr = gst_caps_to_string (caps);
g_warning ("don't know how to handle %s", capsstr);
GST_ELEMENT_ERROR (play_base_bin, STREAM, TYPE_NOT_FOUND,
("Don't know how to handle %s", capsstr), (NULL));
g_free (capsstr);
}