diff options
author | Niklas Haas <git@nand.wakku.to> | 2015-03-27 13:27:40 +0100 |
---|---|---|
committer | Niklas Haas <git@nand.wakku.to> | 2015-05-27 11:09:41 +0200 |
commit | 4d6b9550fe1e0354461716f560d71d78196d5da5 (patch) | |
tree | c3b819660467c8f48e89616b5e5e2fa46e06c090 /video/out/gl_lcms.c | |
parent | bf4dd877e9f1e4508f0031e61c7f40cd612be448 (diff) | |
download | mpv-4d6b9550fe1e0354461716f560d71d78196d5da5.tar.bz2 mpv-4d6b9550fe1e0354461716f560d71d78196d5da5.tar.xz |
vo_opengl: add support for custom shaders
Diffstat (limited to 'video/out/gl_lcms.c')
-rw-r--r-- | video/out/gl_lcms.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/video/out/gl_lcms.c b/video/out/gl_lcms.c index b7ee51360c..ec3013c553 100644 --- a/video/out/gl_lcms.c +++ b/video/out/gl_lcms.c @@ -102,18 +102,6 @@ static void lcms2_error_handler(cmsContext ctx, cmsUInt32Number code, MP_ERR(p, "lcms2: %s\n", msg); } -static struct bstr load_file(void *talloc_ctx, const char *filename, - struct mpv_global *global) -{ - struct bstr res = {0}; - stream_t *s = stream_open(filename, global); - if (s) { - res = stream_read_complete(s, talloc_ctx, 1000000000); - free_stream(s); - } - return res; -} - static bool load_profile(struct gl_lcms *p) { if (p->icc_data && p->icc_size) @@ -124,7 +112,8 @@ static bool load_profile(struct gl_lcms *p) char *fname = mp_get_user_path(NULL, p->global, p->icc_path); MP_VERBOSE(p, "Opening ICC profile '%s'\n", fname); - struct bstr iccdata = load_file(p, fname, p->global); + struct bstr iccdata = stream_read_file(fname, p, p->global, + 100000000); // 100 MB talloc_free(fname); if (!iccdata.len) return false; @@ -238,7 +227,8 @@ bool gl_lcms_get_lut3d(struct gl_lcms *p, struct lut3d **result_lut3d) // check cache if (cache_file) { MP_VERBOSE(p, "Opening 3D LUT cache in file '%s'.\n", cache_file); - struct bstr cachedata = load_file(tmp, cache_file, p->global); + struct bstr cachedata = stream_read_file(cache_file, tmp, p->global, + 1000000000); // 1 GB if (cachedata.len == talloc_get_size(output)) { memcpy(output, cachedata.start, cachedata.len); goto done; |