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

Rémi Denis-Courmont remi at remlab.net
Mon Mar 24 15:27:29 CET 2014


On Mon, 24 Mar 2014 14:38:24 +0100, Jean-Baptiste Kempf <jb at videolan.org>
wrote:
> 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 );

If you intend to represent file paths and file URIs with GUIDs, then that
should be (pseudo-code):

if (IIDFromString(path, ...))
    return "file://" + path;
else
    return NULL;

That is only useful if stdio.h and io.h/unistd.h except GUIDs though.

-- 
Rémi Denis-Courmont
Sent from my collocated server



More information about the vlc-devel mailing list