plugins/elements/: Also check for an absolute path following file:// in the filesrc element. Remove redundant check a...

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.
This commit is contained in:
Sebastian Dröge 2007-02-13 13:40:05 +00:00
parent 5ee6741827
commit 67a92e45a2
3 changed files with 20 additions and 6 deletions

View file

@ -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> 2007-02-13 Stefan Kost <ensonic@users.sf.net>
* docs/design/draft-klass.txt: * docs/design/draft-klass.txt:

View 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" with uri + 16 because it provides unescaping */
location = gst_uri_get_location (tmp); location = gst_uri_get_location (tmp);
g_free (tmp); g_free (tmp);
} else if (!g_str_has_prefix (uri, "file:///")) {
return FALSE;
} else { } else {
location = gst_uri_get_location (uri); 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); ret = gst_file_sink_set_location (sink, location);

View 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" with uri + 16 because it provides unescaping */
location = gst_uri_get_location (tmp); location = gst_uri_get_location (tmp);
g_free (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 { } else {
location = gst_uri_get_location (uri); 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); ret = gst_file_src_set_location (src, location);