From 2ff8c8777f16643a66f8480275c6d581d7c2f8ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Wed, 25 May 2011 18:45:33 +0100 Subject: [PATCH] seek: use gst_filename_to_uri() to convert a filename to a uri --- tests/examples/seek/seek.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/examples/seek/seek.c b/tests/examples/seek/seek.c index 34d8a3b00a..ef3fce4a74 100644 --- a/tests/examples/seek/seek.c +++ b/tests/examples/seek/seek.c @@ -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); } }