summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-05-02 16:29:30 +0200
committerwm4 <wm4@nowhere>2015-05-02 16:29:30 +0200
commitff1b5432e777c83af9ac55cc72ecd7a7344b9476 (patch)
tree4063fdaad522db1723ad13f53d49708fef7ccd1e /video
parenta52a494fe4e5cfb97aaaaf5a906516a84ce3ece2 (diff)
downloadmpv-ff1b5432e777c83af9ac55cc72ecd7a7344b9476.tar.bz2
mpv-ff1b5432e777c83af9ac55cc72ecd7a7344b9476.tar.xz
vo_opengl: gl_lcms: use mp_path_join()
Maybe this fixes the win32 problems a user had, or maybe not. Also, check if cache_dir is set at all. An empty string should be equivalent to "unset".
Diffstat (limited to 'video')
-rw-r--r--video/out/gl_lcms.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/video/out/gl_lcms.c b/video/out/gl_lcms.c
index 6f98fc9456..337664d8b9 100644
--- a/video/out/gl_lcms.c
+++ b/video/out/gl_lcms.c
@@ -206,7 +206,7 @@ bool gl_lcms_get_lut3d(struct gl_lcms *p, struct lut3d **result_lut3d)
cmsContext cms = NULL;
char *cache_file = NULL;
- if (p->opts.cache_dir) {
+ if (p->opts.cache_dir && p->opts.cache_dir[0]) {
// Gamma is included in the header to help uniquely identify it,
// because we may change the parameter in the future or make it
// customizable, same for the primaries.
@@ -224,10 +224,10 @@ bool gl_lcms_get_lut3d(struct gl_lcms *p, struct lut3d **result_lut3d)
av_sha_final(sha, hash);
av_free(sha);
- cache_file = talloc_strdup(tmp, p->opts.cache_dir);
- cache_file = talloc_asprintf_append(cache_file, "/");
+ cache_file = talloc_strdup(tmp, "");
for (int i = 0; i < sizeof(hash); i++)
cache_file = talloc_asprintf_append(cache_file, "%02X", hash[i]);
+ cache_file = mp_path_join(tmp, bstr0(p->opts.cache_dir), bstr0(cache_file));
}
// check cache