mirror of
https://github.com/mpv-player/mpv.git
synced 2025-12-28 05:33:14 +00:00
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.
This commit is contained in:
@@ -24,7 +24,7 @@ void osd_object_get_bitmaps(struct osd_state *osd, struct osd_object *obj,
|
||||
*out_imgs = (struct sub_bitmaps) {0};
|
||||
}
|
||||
|
||||
void osd_object_get_resolution(struct osd_state *osd, struct osd_object *obj,
|
||||
void osd_object_get_resolution(struct osd_state *osd, int obj,
|
||||
int *out_w, int *out_h)
|
||||
{
|
||||
*out_w = 0;
|
||||
|
||||
Reference in New Issue
Block a user