From f845f64c2abe4361084b4bc07f5f1ea5dd43ec9f Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 16 Sep 2016 14:21:09 +0200 Subject: osd: fix subtitle/overlay update problems This could in theory lead to missed updates if subtitles were switched or external OSD overlays (via overlay-add) were updated. While the change IDs of each of those were consistent, switching between two separate OSD sources is not, and we have to explicitly trigger a change. Regression since commit 9c9cf125. The new code is actually better, because we do exactly what is needed, and don't just mess with the update ID for libass-based OSD. --- sub/osd.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'sub') diff --git a/sub/osd.c b/sub/osd.c index 220c1d9c0d..1f743792da 100644 --- a/sub/osd.c +++ b/sub/osd.c @@ -169,8 +169,11 @@ void osd_set_text(struct osd_state *osd, const char *text) void osd_set_sub(struct osd_state *osd, int index, struct dec_sub *dec_sub) { pthread_mutex_lock(&osd->lock); - if (index >= 0 && index < 2) - osd->objs[OSDTYPE_SUB + index]->sub = dec_sub; + if (index >= 0 && index < 2) { + struct osd_object *obj = osd->objs[OSDTYPE_SUB + index]; + obj->sub = dec_sub; + obj->vo_change_id += 1; + } osd_changed_unlocked(osd); pthread_mutex_unlock(&osd->lock); } @@ -208,6 +211,7 @@ void osd_set_external2(struct osd_state *osd, struct sub_bitmaps *imgs) { pthread_mutex_lock(&osd->lock); osd->objs[OSDTYPE_EXTERNAL2]->external2 = imgs; + osd->objs[OSDTYPE_EXTERNAL2]->vo_change_id += 1; osd_changed_unlocked(osd); pthread_mutex_unlock(&osd->lock); } -- cgit v1.2.3