diff options
author | Niklas Haas <git@haasn.xyz> | 2017-09-21 16:13:52 +0200 |
---|---|---|
committer | Niklas Haas <git@haasn.xyz> | 2017-09-21 16:13:52 +0200 |
commit | 52789d6ca002eb22cf64876ec2a05ef86b24468a (patch) | |
tree | 5666623b4da9721ad460460d28d3ad6392deaed7 /video/out/vo_gpu.c | |
parent | aefd7a90c90bfcde90062a21b72e15d94b88e726 (diff) | |
download | mpv-52789d6ca002eb22cf64876ec2a05ef86b24468a.tar.bz2 mpv-52789d6ca002eb22cf64876ec2a05ef86b24468a.tar.xz |
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..
Diffstat (limited to 'video/out/vo_gpu.c')
-rw-r--r-- | video/out/vo_gpu.c | 6 |
1 files changed, 4 insertions, 2 deletions
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); } |