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.
This commit is contained in:
Stefano Pigozzi 2014-04-05 18:05:14 +02:00
parent e2bd5139ad
commit aa77f5dd3c
1 changed files with 3 additions and 1 deletions

View File

@ -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: ;