[vlc-devel] [PATCH] src: fix some features not available on Windows App Store versions

Rémi Denis-Courmont remi at remlab.net
Mon Jul 20 15:12:47 CEST 2015


Le 2015-07-20 15:42, Steve Lhomme a écrit :
> From: Steve Lhomme <robUx4 at gmail.com>
>
> ---
>  src/text/strings.c | 2 +-
>  src/text/url.c     | 7 ++++++-
>  src/win32/dirs.c   | 4 ++++
>  3 files changed, 11 insertions(+), 2 deletions(-)
>
> diff --git a/src/text/strings.c b/src/text/strings.c
> index 433a0eb..606bb17 100644
> --- a/src/text/strings.c
> +++ b/src/text/strings.c
> @@ -545,7 +545,7 @@ char *str_format_meta(input_thread_t *input,
> const char *s)
>      size_t len;
>  #ifdef HAVE_OPEN_MEMSTREAM
>      FILE *stream = open_memstream(&str, &len);
> -#elif defined( _WIN32 )
> +#elif defined(_WIN32) && !VLC_WINSTORE_APP
>      FILE *stream = vlc_win32_tmpfile();

Does tmpfile() actually work?

>  #else
>      FILE *stream = tmpfile();
> diff --git a/src/text/url.c b/src/text/url.c
> index f2d7fb9..9551377 100644
> --- a/src/text/url.c
> +++ b/src/text/url.c
> @@ -190,6 +190,11 @@ char *vlc_path2uri (const char *path, const char
> *scheme)
>          }
>      }
>      else
> +#if VLC_WINSTORE_APP
> +    if ((!strncmp(path, "file://{", 8) || path[0] == '{') &&
> strlen(path) > 32)
> +        return strdup( path );
> +    else
> +#endif

Is that really Microsoft's intent? Using URIs complete with scheme, as 
file paths seems very weird.

>      if (!strncmp (path, "\\\\", 2))
>      {   /* Windows UNC paths */
>          /* \\host\share\path -> file://host/share/path */
> @@ -490,7 +495,7 @@ static char *vlc_idna_to_ascii (const char *idn)
>          return NULL;
>      return adn;
>
> -#elif defined (_WIN32) && (_WIN32_WINNT >= 0x0601)
> +#elif defined (_WIN32) && (_WIN32_WINNT >= 0x0601) &&
> !defined(VLC_WINSTORE_APP)
>      char *ret = NULL;
>
>      wchar_t *wide = ToWide (idn);
> diff --git a/src/win32/dirs.c b/src/win32/dirs.c
> index 7a62bfc..06a0c5c 100644
> --- a/src/win32/dirs.c
> +++ b/src/win32/dirs.c
> @@ -87,6 +87,9 @@ static char *config_GetShellDir (int csidl)
>
>  static char *config_GetAppDir (void)
>  {
> +#if VLC_WINSTORE_APP
> +    return NULL;
> +#else
>      /* if portable directory exists, use it */
>      TCHAR path[MAX_PATH];
>      if (GetModuleFileName (NULL, path, MAX_PATH))
> @@ -110,6 +113,7 @@ static char *config_GetAppDir (void)
>          psz_dir = NULL;
>      free (psz_parent);
>      return psz_dir;
> +#endif
>  }
>
>  #warning FIXME Use known folders on Vista and above

-- 
Rémi Denis-Courmont
http://www.remlab.net/



More information about the vlc-devel mailing list