summaryrefslogtreecommitdiffstats
path: root/sub
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-09-16 14:21:09 +0200
committerwm4 <wm4@nowhere>2016-09-16 14:26:30 +0200
commitf845f64c2abe4361084b4bc07f5f1ea5dd43ec9f (patch)
tree28939cc00787ad1fa8c4da02dd8f6785127e8274 /sub
parentb83bfea05df01c7bcd15d594c4b8aebf60f8618a (diff)
downloadmpv-f845f64c2abe4361084b4bc07f5f1ea5dd43ec9f.tar.bz2
mpv-f845f64c2abe4361084b4bc07f5f1ea5dd43ec9f.tar.xz
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.
Diffstat (limited to 'sub')
-rw-r--r--sub/osd.c8
1 files changed, 6 insertions, 2 deletions
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);
}