diff options
author | Martin Herkt <lachs0r@srsfckn.biz> | 2015-03-07 12:32:19 +0100 |
---|---|---|
committer | Martin Herkt <lachs0r@srsfckn.biz> | 2015-03-07 13:00:06 +0100 |
commit | 1bab7f69aeb1ee80fdd2f75d7658cd5fef7ee2e3 (patch) | |
tree | 2f59914887a0970eb5f4f1bf74e49b5b346f0bdc /video/out/vo_opengl.c | |
parent | 5cddd4ccca79405ea57fcd423a554ddf12da0126 (diff) | |
download | mpv-1bab7f69aeb1ee80fdd2f75d7658cd5fef7ee2e3.tar.bz2 mpv-1bab7f69aeb1ee80fdd2f75d7658cd5fef7ee2e3.tar.xz |
vo_opengl/x11: fix automatic ICC profile loading
mpv would attempt to load ICC profiles several times during VO init
even if no window is displayed. This potentially causes it to load
a profile for a different screen than it is going to be displayed
on, thereby invalidating the profile cache and rebuilding the LUT
every single time.
It would not unload a previously loaded profile when the video
window is moved to a display without an installed profile.
Fix these issues and tweak the log messages a little.
Diffstat (limited to 'video/out/vo_opengl.c')
-rw-r--r-- | video/out/vo_opengl.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/video/out/vo_opengl.c b/video/out/vo_opengl.c index 9318914dbd..887a8d8fbd 100644 --- a/video/out/vo_opengl.c +++ b/video/out/vo_opengl.c @@ -254,15 +254,17 @@ static bool get_and_update_icc_profile(struct gl_priv *p, int *events) { if (p->icc_opts->profile_auto) { MP_VERBOSE(p, "Querying ICC profile...\n"); - bstr icc; + bstr icc = bstr0(NULL); int r = p->glctx->vo_control(p->vo, events, VOCTRL_GET_ICC_PROFILE, &icc); - if (r == VO_TRUE) { + if (r != VO_NOTAVAIL) { + if (r == VO_FALSE) { + MP_WARN(p, "Could not retrieve an ICC profile.\n"); + } else if (r == VO_NOTIMPL) { + MP_ERR(p, "icc-profile-auto not implemented on this platform.\n"); + } + gl_lcms_set_memory_profile(p->cms, &icc); - } else if (r == VO_NOTIMPL) { - MP_ERR(p, "icc-profile-auto not implemented on this platform.\n"); - } else { - MP_ERR(p, "Could not retrieve an ICC profile.\n"); } } |