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. --- player/video.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'player/video.c') diff --git a/player/video.c b/player/video.c index 17eaab619e..6f634270d2 100644 --- a/player/video.c +++ b/player/video.c @@ -126,8 +126,8 @@ static void recreate_video_filters(struct MPContext *mpctx) // for vf_sub vf_control_any(d_video->vfilter, VFCTRL_SET_OSD_OBJ, mpctx->osd); - mpctx->osd->render_subs_in_filter - = vf_control_any(d_video->vfilter, VFCTRL_INIT_OSD, NULL) == CONTROL_OK; + osd_set_render_subs_in_filter(mpctx->osd, + vf_control_any(d_video->vfilter, VFCTRL_INIT_OSD, NULL) == CONTROL_OK); set_allowed_vo_formats(d_video->vfilter, mpctx->video_out); } -- cgit v1.2.3