From 52789d6ca002eb22cf64876ec2a05ef86b24468a Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Thu, 21 Sep 2017 16:13:52 +0200 Subject: vo_gpu: fix vo=opengl legacy alias Turns out the option code apparently tries to directly talloc_free() the allocated strings, instead of going through a tactx wrapper or something. So we can't directly overwrite it. Do something else instead.. --- video/out/vo_gpu.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'video') diff --git a/video/out/vo_gpu.c b/video/out/vo_gpu.c index 5df9e06f47..8a5e46bea0 100644 --- a/video/out/vo_gpu.c +++ b/video/out/vo_gpu.c @@ -47,6 +47,7 @@ struct gpu_priv { struct mp_log *log; struct ra_ctx *ctx; + bool force_gl; // for vo=opengl back-compat char *context_name; char *context_type; struct ra_ctx_opts opts; @@ -289,7 +290,8 @@ static int preinit(struct vo *vo) struct ra_ctx_opts opts = p->opts; opts.want_alpha = alpha_mode == 1; - p->ctx = ra_ctx_create(vo, p->context_type, p->context_name, opts); + const char *type = p->force_gl ? "opengl" : p->context_type; + p->ctx = ra_ctx_create(vo, type, p->context_name, opts); if (!p->ctx) goto err_out; assert(p->ctx->ra); @@ -361,7 +363,7 @@ static int preinit_opengl(struct vo *vo) " be removed in the future!\n"); struct gpu_priv *p = vo->priv; - p->context_type = "opengl"; + p->force_gl = true; return preinit(vo); } -- cgit v1.2.3