[vlc-devel] [PATCH] [HACK][IDEAS?] Accept the weird WinRT pathes

Jean-Baptiste Kempf jb at videolan.org
Mon Mar 24 14:38:24 CET 2014


With Windows Store Apps, we are not allowed to open files path outside
of the sandbox.

But we can if the opening was instantiated by a FilePicker, and we get
a UUID to open it. We therefore use path like winrt://{xxxx-xxx-xxxxxx}

This patch/hack allows it to work through the expected code of VLC,
notably for subtitles.

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
---
 src/text/url.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/text/url.c b/src/text/url.c
index 3492a54..3aa3ad5 100644
--- a/src/text/url.c
+++ b/src/text/url.c
@@ -191,6 +191,11 @@ char *vlc_path2uri (const char *path, const char *scheme)
     }
     else
 #endif
+#if VLC_WINSTORE_APP
+    if ((!strncmp(path, "file://{", 8) || path[0] == '{') && strlen(path) > 32)
+        return strdup( path );
+    else
+#endif
     if (!strncmp (path, "\\\\", 2))
     {   /* Windows UNC paths */
 #if !defined( _WIN32 ) && !defined( __OS2__ )
-- 
1.9.1




More information about the vlc-devel mailing list