summaryrefslogtreecommitdiffstats
path: root/video/out/x11_common.c
diff options
context:
space:
mode:
authorMartin Herkt <lachs0r@srsfckn.biz>2015-03-07 12:32:19 +0100
committerMartin Herkt <lachs0r@srsfckn.biz>2015-03-07 13:00:06 +0100
commit1bab7f69aeb1ee80fdd2f75d7658cd5fef7ee2e3 (patch)
tree2f59914887a0970eb5f4f1bf74e49b5b346f0bdc /video/out/x11_common.c
parent5cddd4ccca79405ea57fcd423a554ddf12da0126 (diff)
downloadmpv-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/x11_common.c')
-rw-r--r--video/out/x11_common.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/video/out/x11_common.c b/video/out/x11_common.c
index 50a4256c8f..3ae753a234 100644
--- a/video/out/x11_common.c
+++ b/video/out/x11_common.c
@@ -1703,6 +1703,8 @@ int vo_x11_control(struct vo *vo, int *events, int request, void *arg)
return VO_TRUE;
}
case VOCTRL_GET_ICC_PROFILE: {
+ if (!x11->pseudo_mapped)
+ return VO_NOTAVAIL;
int screen = 0; // xinerama screen number
for (int n = 0; n < x11->num_displays; n++) {
struct xrandr_display *disp = &x11->displays[n];
@@ -1717,6 +1719,7 @@ int vo_x11_control(struct vo *vo, int *events, int request, void *arg)
mp_snprintf_cat(prop, sizeof(prop), "_%d", screen);
x11->icc_profile_property = XAs(x11, prop);
int len;
+ MP_VERBOSE(x11, "Retrieving ICC profile for display: %d\n", screen);
void *icc = x11_get_property(x11, x11->rootwin, x11->icc_profile_property,
XA_CARDINAL, 8, &len);
if (!icc)