Skip to content

Commit

Permalink
vo_gpu: fix vo=opengl legacy alias
Browse files Browse the repository at this point in the history
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..
  • Loading branch information
haasn committed Sep 21, 2017
1 parent aefd7a9 commit 52789d6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions video/out/vo_gpu.c
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}

Expand Down

0 comments on commit 52789d6

Please sign in to comment.