plugins/elements/: Also check for an absolute path following file:// in the filesrc...
authorSebastian Dröge <slomo@circular-chaos.org>
Tue, 13 Feb 2007 13:40:05 +0000 (13:40 +0000)
committerSebastian Dröge <slomo@circular-chaos.org>
Tue, 13 Feb 2007 13:40:05 +0000 (13:40 +0000)
Original commit message from CVS:
* plugins/elements/gstfilesink.c: (gst_file_sink_uri_set_uri):
* plugins/elements/gstfilesrc.c: (gst_file_src_uri_set_uri):
Also check for an absolute path following file:// in the filesrc
element. Remove redundant check and call g_path_is_absolute() on the
unescaped location.

ChangeLog
plugins/elements/gstfilesink.c
plugins/elements/gstfilesrc.c

index 45a9c7f..1ed8a79 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2007-02-13  Sebastian Dröge  <slomo@circular-chaos.org>
+
+       * plugins/elements/gstfilesink.c: (gst_file_sink_uri_set_uri):
+       * plugins/elements/gstfilesrc.c: (gst_file_src_uri_set_uri):
+       Also check for an absolute path following file:// in the filesrc
+       element. Remove redundant check and call g_path_is_absolute() on the
+       unescaped location.
+
 2007-02-13  Stefan Kost  <ensonic@users.sf.net>
 
        * docs/design/draft-klass.txt:
index 762121c..09c3be6 100644 (file)
@@ -554,10 +554,14 @@ gst_file_sink_uri_set_uri (GstURIHandler * handler, const gchar * uri)
      * "location" with uri + 16 because it provides unescaping */
     location = gst_uri_get_location (tmp);
     g_free (tmp);
-  } else if (!g_str_has_prefix (uri, "file:///")) {
-    return FALSE;
   } else {
     location = gst_uri_get_location (uri);
+    if (!location)
+      return FALSE;
+    if (!g_path_is_absolute (location)) {
+      g_free (location);
+      return FALSE;
+    }
   }
 
   ret = gst_file_sink_set_location (sink, location);
index dfd88db..2300bc1 100644 (file)
@@ -1074,12 +1074,14 @@ gst_file_src_uri_set_uri (GstURIHandler * handler, const gchar * uri)
      * "location" with uri + 16 because it provides unescaping */
     location = gst_uri_get_location (tmp);
     g_free (tmp);
-  } else if (!g_str_has_prefix (uri, "file://")) {
-    return FALSE;
-  } else if (!g_path_is_absolute (uri + strlen ("file://"))) {
-    return FALSE;
   } else {
     location = gst_uri_get_location (uri);
+    if (!location)
+      return FALSE;
+    if (!g_path_is_absolute (location)) {
+      g_free (location);
+      return FALSE;
+    }
   }
 
   ret = gst_file_src_set_location (src, location);