mirror of
https://github.com/mpv-player/mpv
synced 2024-12-24 15:52:25 +00:00
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:
parent
e2bd5139ad
commit
aa77f5dd3c
@ -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: ;
|
||||
|
Loading…
Reference in New Issue
Block a user