mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-10-07 03:02:17 +00:00
seek: use gst_filename_to_uri() to convert a filename to a uri
This commit is contained in:
parent
882ffb3b5b
commit
2ff8c8777f
1 changed files with 4 additions and 2 deletions
|
@ -931,11 +931,13 @@ playerbin_set_uri (GstElement * player, const gchar * location)
|
|||
gchar *uri;
|
||||
|
||||
/* Add "file://" prefix for convenience */
|
||||
if (g_str_has_prefix (location, "/")) {
|
||||
uri = g_strconcat ("file://", location, NULL);
|
||||
if (g_str_has_prefix (location, "/") || !gst_uri_is_valid (location)) {
|
||||
uri = gst_filename_to_uri (location, NULL);
|
||||
g_print ("Setting URI: %s\n", uri);
|
||||
g_object_set (G_OBJECT (player), "uri", uri, NULL);
|
||||
g_free (uri);
|
||||
} else {
|
||||
g_print ("Setting URI: %s\n", location);
|
||||
g_object_set (G_OBJECT (player), "uri", location, NULL);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue