summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorStefano Pigozzi <stefano.pigozzi@gmail.com>2014-04-05 18:05:14 +0200
committerStefano Pigozzi <stefano.pigozzi@gmail.com>2014-04-05 18:13:00 +0200
commitaa77f5dd3c5b4f064343f56ce59757e39768ab05 (patch)
tree156cb2e264bbbec3e9423128804b659d1f36dfdf /video
parente2bd5139adac0f47c26e425280fbf92227523d9d (diff)
downloadmpv-aa77f5dd3c5b4f064343f56ce59757e39768ab05.tar.bz2
mpv-aa77f5dd3c5b4f064343f56ce59757e39768ab05.tar.xz
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.
Diffstat (limited to 'video')
-rw-r--r--video/out/gl_lcms.c4
1 files changed, 3 insertions, 1 deletions
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: ;