1
0
mirror of https://github.com/mpv-player/mpv synced 2025-03-21 02:41:13 +00:00

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 
This commit is contained in:
Niklas Haas 2018-01-15 00:35:51 +01:00 committed by Kevin Mitchell
parent e7ea893c2f
commit 0192eeb09c

View File

@ -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: