From 167b75c50c673bc477d0b18b38cd1d20292ce8b8 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 23 Mar 2015 16:32:59 +0100 Subject: vo_opengl_cb: don't render OSD while VO is not created Unlike other VOs, this rendered OSD even while no VO was created (because the renderer lives as long as the API user wants). Change this, and refactor the code so that the OSD object is accessible only while the VO is created. (There is a short time where the OSD can still be accessed even after VO destruction - this is not a race condition, though it's inelegant and unfortunately unavoidable.) --- player/client.c | 2 +- player/client.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) (limited to 'player') diff --git a/player/client.c b/player/client.c index 3ed7ea620e..0285ec76b4 100644 --- a/player/client.c +++ b/player/client.c @@ -1685,7 +1685,7 @@ static mpv_opengl_cb_context *opengl_cb_get_context(mpv_handle *ctx) { mpv_opengl_cb_context *cb = ctx->mpctx->gl_cb_ctx; if (!cb) { - cb = mp_opengl_create(ctx->mpctx->global, ctx->mpctx->osd, ctx->clients); + cb = mp_opengl_create(ctx->mpctx->global, ctx->clients); ctx->mpctx->gl_cb_ctx = cb; } return cb; diff --git a/player/client.h b/player/client.h index 656e3601cb..5bc3c770eb 100644 --- a/player/client.h +++ b/player/client.h @@ -42,7 +42,6 @@ struct mpv_opengl_cb_context; struct mpv_global; struct osd_state; struct mpv_opengl_cb_context *mp_opengl_create(struct mpv_global *g, - struct osd_state *osd, struct mp_client_api *client_api); void kill_video(struct mp_client_api *client_api); -- cgit v1.2.3