diff --git a/video/out/vo_opengl.c b/video/out/vo_opengl.c index d8269bdb01..8dec7232a0 100644 --- a/video/out/vo_opengl.c +++ b/video/out/vo_opengl.c @@ -253,10 +253,10 @@ static bool update_icc_profile(struct gl_priv *p) return true; } -static bool get_and_update_icc_profile(struct gl_priv *p) +static bool get_and_update_icc_profile(struct gl_priv *p, int *events) { bstr icc; - int r = p->glctx->vo_control(p->vo, NULL, VOCTRL_GET_ICC_PROFILE, &icc); + int r = p->glctx->vo_control(p->vo, events, VOCTRL_GET_ICC_PROFILE, &icc); if (r == VO_FALSE) { MP_WARN(p->vo, "Could not retrieve an ICC profile.\n"); @@ -373,14 +373,14 @@ static int control(struct vo *vo, uint32_t request, void *data) mpgl_lock(p->glctx); int events = 0; int r = p->glctx->vo_control(vo, &events, request, data); + if (events & VO_EVENT_ICC_PROFILE_PATH_CHANGED) { + get_and_update_icc_profile(p, &events); + vo->want_redraw = true; + } if (events & VO_EVENT_RESIZE) resize(p); if (events & VO_EVENT_EXPOSE) vo->want_redraw = true; - if (events & VO_EVENT_ICC_PROFILE_PATH_CHANGED) { - get_and_update_icc_profile(p); - vo->want_redraw = true; - } vo_event(vo, events); mpgl_unlock(p->glctx); @@ -433,7 +433,7 @@ static int preinit(struct vo *vo) if (!p->cms) goto err_out; gl_lcms_set_options(p->cms, p->icc_opts); - if (!get_and_update_icc_profile(p)) + if (!get_and_update_icc_profile(p, &(int){0})) goto err_out; mpgl_unset_context(p->glctx);