1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-19 05:15:12 +00:00

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..
This commit is contained in:
Niklas Haas 2017-09-21 16:13:52 +02:00
parent aefd7a90c9
commit 52789d6ca0
No known key found for this signature in database
GPG Key ID: 9A09076581B27402

View File

@ -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);
}