parse: escape \ with a \ as well, so that we don't lose the \ when unescaping
authorChristophe Fergeau <teuf@gnome.org>
Wed, 27 Jun 2012 18:59:29 +0000 (19:59 +0100)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Wed, 27 Jun 2012 18:59:29 +0000 (19:59 +0100)
If we have a file called Foo\Bar.ogg, there is no way to pass
that filename properly to filesrc in gst_parse_launch(), since
gst_parse_unescape() will just unescape \x to x.

Not cherry-picking this into 0.10 since there are apparently
apps that work around this problem and which would break if
we fixed it there too.

https://bugzilla.gnome.org/show_bug.cgi?id=673319

gst/gstparse.c

index 3e6714d..9f3208b 100644 (file)
@@ -187,7 +187,7 @@ _gst_parse_escape (const gchar * str)
   gstr = g_string_sized_new (strlen (str));
 
   while (*str) {
-    if (*str == ' ')
+    if (*str == ' ' || *str == '\\')
       g_string_append_c (gstr, '\\');
     g_string_append_c (gstr, *str);
     str++;