From 0192eeb09cddcfe543ca87dd769efc61a1d73430 Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Mon, 15 Jan 2018 00:35:51 +0100 Subject: vo_gpu: rpi: defer gl_ctx_resize until after gl_ctx_init This segfaults otherwise. The conditional is needed to break a circular dependency (gl_init depends on mpgl_load_functions which depends on recreate_dispmanx which calls gl_ctx_resize). Fixes #5398 --- video/out/opengl/context_rpi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/video/out/opengl/context_rpi.c b/video/out/opengl/context_rpi.c index 8b447d0bfc..1b81e6a460 100644 --- a/video/out/opengl/context_rpi.c +++ b/video/out/opengl/context_rpi.c @@ -198,7 +198,8 @@ static bool recreate_dispmanx(struct ra_ctx *ctx) ctx->vo->dwidth = p->w; ctx->vo->dheight = p->h; - ra_gl_ctx_resize(ctx->swapchain, p->w, p->h, 0); + if (ctx->swapchain) + ra_gl_ctx_resize(ctx->swapchain, p->w, p->h, 0); ctx->vo->want_redraw = true; @@ -247,6 +248,7 @@ static bool rpi_init(struct ra_ctx *ctx) if (!ra_gl_ctx_init(ctx, &p->gl, params)) goto fail; + ra_gl_ctx_resize(ctx->swapchain, ctx->vo->dwidth, ctx->vo->dheight, 0); return true; fail: -- cgit v1.2.3