[vlc-devel] [PATCH] modules: on winstore we cannot save plugins.dat in the plugins folder
Jean-Baptiste Kempf
jb at videolan.org
Tue Sep 26 15:36:42 CEST 2017
I'm sorry, but that is very ugly... Can't we do something without
touching the common part?
On Tue, 26 Sep 2017, at 14:16, Steve Lhomme wrote:
> We can save it in the config folder.
> ---
> src/modules/bank.c | 18 ++++++++++++++++--
> 1 file changed, 16 insertions(+), 2 deletions(-)
>
> diff --git a/src/modules/bank.c b/src/modules/bank.c
> index 4cc0e9a74e..41b320f101 100644
> --- a/src/modules/bank.c
> +++ b/src/modules/bank.c
> @@ -398,6 +398,17 @@ static void AllocatePluginDir (module_bank_t *bank,
> unsigned maxdepth,
> static void AllocatePluginPath(vlc_object_t *obj, const char *path,
> cache_mode_t mode)
> {
> + const char *cache_path;
> +#if VLC_WINSTORE_APP
> + cache_path = config_GetUserDir(VLC_CONFIG_DIR);
> + if (cache_path == NULL)
> + {
> + msg_Warn(obj, "no suitable storage path for the plugins cache");
> + return;
> + }
> +#else
> + cache_path = path;
> +#endif
> module_bank_t bank =
> {
> .obj = obj,
> @@ -406,7 +417,7 @@ static void AllocatePluginPath(vlc_object_t *obj,
> const char *path,
> };
>
> if (mode & CACHE_READ_FILE)
> - bank.cache = vlc_cache_load(obj, path, &modules.caches);
> + bank.cache = vlc_cache_load(obj, cache_path, &modules.caches);
> else
> msg_Dbg(bank.obj, "ignoring plugins cache file");
>
> @@ -431,7 +442,10 @@ static void AllocatePluginPath(vlc_object_t *obj,
> const char *path,
> }
>
> if (mode & CACHE_WRITE_FILE)
> - CacheSave(obj, path, bank.plugins, bank.size);
> + CacheSave(obj, cache_path, bank.plugins, bank.size);
> +#if VLC_WINSTORE_APP
> + free((char*)cache_path);
> +#endif
>
> free(bank.plugins);
> }
> --
> 2.12.1
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
--
Jean-Baptiste Kempf - President
+33 672 704 734
More information about the vlc-devel
mailing list