summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-01-08 18:27:22 +0100
committerwm4 <wm4@nowhere>2015-01-08 18:30:19 +0100
commitf6e466585a1a1ad9b95afe4f98c15e89f21d2fe4 (patch)
treecd3fdd0c43a4c9bd2677c73617ec50079924dbab
parent88c6f18209474d05a29a0c13f5473e6aa02455f4 (diff)
downloadmpv-f6e466585a1a1ad9b95afe4f98c15e89f21d2fe4.tar.bz2
mpv-f6e466585a1a1ad9b95afe4f98c15e89f21d2fe4.tar.xz
vo_opengl: don't crash win32 backend with NULL events
vo_opengl was crashing since f811348d because it passed NULL for the events parameter to vo_control. Normally the parameter should not be NULL, so add a hack to account for this. In particular, we should handle the events that are returned. For the call in preinit() we skip this, but it most likely has no meaning anyway, because in this stage no window is visible yet.
-rw-r--r--video/out/vo_opengl.c14
1 files changed, 7 insertions, 7 deletions
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);