From aa77f5dd3c5b4f064343f56ce59757e39768ab05 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sat, 5 Apr 2014 18:05:14 +0200 Subject: gl_lcms: properly expand the cache filename being written This is needed to preserve the same path used when opening the cache file, and correctly expands ~ when icc-cache is added to the mpv config file. --- video/out/gl_lcms.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/video/out/gl_lcms.c b/video/out/gl_lcms.c index 2175793cf3..ad1bd1bb96 100644 --- a/video/out/gl_lcms.c +++ b/video/out/gl_lcms.c @@ -213,13 +213,15 @@ struct lut3d *mp_load_icc(struct mp_icc_opts *opts, struct mp_log *log, cmsDeleteTransform(trafo); if (opts->cache) { - FILE *out = fopen(opts->cache, "wb"); + char *fname = mp_get_user_path(NULL, global, opts->cache); + FILE *out = fopen(fname, "wb"); if (out) { fprintf(out, "%s%s", LUT3D_CACHE_HEADER, cache_info); fwrite(iccdata.start, iccdata.len, 1, out); fwrite(output, talloc_get_size(output), 1, out); fclose(out); } + talloc_free(fname); } done: ; -- cgit v1.2.3