From 7f4a09bb8534dfafd83099d773adf2e33c64e267 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 18 Jan 2014 01:19:20 +0100 Subject: sub: uglify OSD code path with locking Do two things: 1. add locking to struct osd_state 2. make struct osd_state opaque While 1. is somewhat simple, 2. is quite horrible. Lots of code accesses lots of osd_state (and osd_object) members. To make sure everything is accessed synchronously, I prefer making osd_state opaque, even if it means adding pretty dumb accessors. All of this is meant to allow running VO in their own threads. Eventually, VOs will request OSD on their own, which means osd_state will be accessed from foreign threads. --- video/out/gl_osd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'video/out/gl_osd.c') diff --git a/video/out/gl_osd.c b/video/out/gl_osd.c index 99b64176ae..393619e554 100644 --- a/video/out/gl_osd.c +++ b/video/out/gl_osd.c @@ -282,7 +282,7 @@ void mpgl_osd_draw_cb(struct mpgl_osd *ctx, { struct draw_cb_closure c = {ctx, cb, cb_ctx}; reset(ctx); - osd_draw(osd, res, osd->vo_pts, 0, ctx->formats, draw_cb, &c); + osd_draw(osd, res, osd_get_vo_pts(osd), 0, ctx->formats, draw_cb, &c); } void mpgl_osd_redraw_cb(struct mpgl_osd *ctx, @@ -376,5 +376,5 @@ static void draw_legacy_cb(void *pctx, struct sub_bitmaps *imgs) void mpgl_osd_draw_legacy(struct mpgl_osd *ctx, struct osd_state *osd, struct mp_osd_res res) { - osd_draw(osd, res, osd->vo_pts, 0, ctx->formats, draw_legacy_cb, ctx); + osd_draw(osd, res, osd_get_vo_pts(osd), 0, ctx->formats, draw_legacy_cb, ctx); } -- cgit v1.2.3