From 0b09771ba9f5a54fe1c8c8612a04dd7a1f1672c6 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 10 May 2020 16:22:16 +0200 Subject: vo_gpu: manually resolve user shader prefixes This resolves prefixes such as "~/" and "~~/" at the caller, instead of relying on stream_read_file() to do it. One of the following commits will remove this from stream_read_file() itself. Untested. --- video/out/gpu/video.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/video/out/gpu/video.c b/video/out/gpu/video.c index 22ce0c3f3b..7564c92eb7 100644 --- a/video/out/gpu/video.c +++ b/video/out/gpu/video.c @@ -29,6 +29,7 @@ #include "misc/bstr.h" #include "options/m_config.h" +#include "options/path.h" #include "common/global.h" #include "options/options.h" #include "utils.h" @@ -493,7 +494,9 @@ static struct bstr load_cached_file(struct gl_video *p, const char *path) return p->files[n].body; } // not found -> load it - struct bstr s = stream_read_file(path, p, p->global, 1000000000); // 1GB + char *fname = mp_get_user_path(NULL, p->global, path); + struct bstr s = stream_read_file(fname, p, p->global, 1000000000); // 1GB + talloc_free(fname); if (s.len) { struct cached_file new = { .path = talloc_strdup(p, path), -- cgit v1.2.3