If the arg looks like a URI, gnomevfs is used, if gnomevfs is not found and the URI starts with file:/, disksrc is used.

Original commit message from CVS:
If the arg looks like a URI, gnomevfs is used, if gnomevfs is not found and
the URI starts with file:/, disksrc is used.
This commit is contained in:
Wim Taymans 2001-05-25 10:43:04 +00:00
parent a7cd58c92e
commit de8d436848

View file

@ -1,5 +1,7 @@
#include <config.h>
#include <string.h>
#include "gstplay.h"
#include "gstplayprivate.h"
#include "full-screen.h"
@ -368,6 +370,7 @@ GstPlayReturn
gst_play_set_uri (GstPlay *play, const guchar *uri)
{
GstPlayPrivate *priv;
gchar* uriloc;
g_return_val_if_fail (play != NULL, GST_PLAY_ERROR);
g_return_val_if_fail (GST_IS_PLAY (play), GST_PLAY_ERROR);
@ -378,17 +381,31 @@ gst_play_set_uri (GstPlay *play, const guchar *uri)
if (priv->uri)
g_free (priv->uri);
priv->uri = g_strdup (uri);
priv->src = gst_elementfactory_make ("gnomevfssrc", "srcelement");
/* see if it looks like a ARI */
if ((uriloc = strstr (uri, ":/"))) {
priv->src = gst_elementfactory_make ("gnomevfssrc", "srcelement");
if (!priv->src) {
if (strstr (uri, "file:/")) {
uri += strlen ("file:/");
}
else
return GST_PLAY_CANNOT_PLAY;
}
}
if (priv->src == NULL) {
priv->src = gst_elementfactory_make ("disksrc", "srcelement");
}
priv->uri = g_strdup (uri);
//priv->src = gst_elementfactory_make ("dvdsrc", "disk_src");
priv->offset_element = priv->src;
g_return_val_if_fail (priv->src != NULL, GST_PLAY_CANNOT_PLAY);
gtk_object_set (GTK_OBJECT (priv->src), "location", uri, NULL);
gtk_object_set (GTK_OBJECT (priv->src), "location", priv->uri, NULL);
priv->cache = gst_elementfactory_make ("autoplugcache", "cache");