[vlc-devel] [PATCH] modules: on winstore we cannot save plugins.dat in the plugins folder
Rémi Denis-Courmont
remi at remlab.net
Tue Sep 26 15:53:12 CEST 2017
Le 26 septembre 2017 16:50:43 GMT+03:00, Steve Lhomme <robux4 at gmail.com> a écrit :
>On Tue, Sep 26, 2017 at 3:46 PM, Rémi Denis-Courmont <remi at remlab.net>
>wrote:
>> Le 26 septembre 2017 15:16:35 GMT+03:00, Steve Lhomme
><robux4 at videolabs.io> a écrit :
>>>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
>>
>> Well I don't really see why. The plugins and their cache should have
>the same permissions and lifetime, i.e. change only during
>(un)installation.
>
>In Winstore apps you cannot write in the location where the binaries
>are. It's sandboxed that way.
>
>> Generating the cache at run-time is a legacy hack that will be killed
>eventually.
>
>That would mean Windows would never have one, since it's (almost)
>always cross compiled.
>
>> --
>> Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez
>excuser ma brièveté.
>> _______________________________________________
>> vlc-devel mailing list
>> To unsubscribe or modify your subscription options:
>> https://mailman.videolan.org/listinfo/vlc-devel
>_______________________________________________
>vlc-devel mailing list
>To unsubscribe or modify your subscription options:
>https://mailman.videolan.org/listinfo/vlc-devel
We don't run the cache plugins at run-time on any platform anymore. This is only there for hysterical raisins. That is über-slow and precisely it violates permissions on most systems (really any system other than Windows desktop and OS/2).
--
Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.
More information about the vlc-devel
mailing list