From 8f76673608e1af606885399f97bcffbfc539d3e0 Mon Sep 17 00:00:00 2001 From: Christoph Heinrich Date: Tue, 7 Feb 2023 19:06:22 +0100 Subject: command: only avoid redrawing when old and new osd are both hidden The `osd-overlay` command didn't trigger a redraw when the overlay was set to hidden. This is fine when the overlay was already hidden before that, but transitioning from not hidden to hidden requires a redraw. --- sub/osd_libass.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sub/osd_libass.c b/sub/osd_libass.c index 7bb0471610..e045bc6539 100644 --- a/sub/osd_libass.c +++ b/sub/osd_libass.c @@ -572,6 +572,11 @@ void osd_set_external(struct osd_state *osd, struct osd_external_ass *ov) goto done; } + if (!entry->ov.hidden || !ov->hidden) { + obj->changed = true; + osd->want_redraw_notification = true; + } + entry->ov.format = ov->format; if (!entry->ov.data) entry->ov.data = talloc_strdup(entry, ""); @@ -585,11 +590,6 @@ void osd_set_external(struct osd_state *osd, struct osd_external_ass *ov) update_external(osd, obj, entry); - if (!entry->ov.hidden) { - obj->changed = true; - osd->want_redraw_notification = true; - } - if (zorder_changed) { qsort(obj->externals, obj->num_externals, sizeof(obj->externals[0]), cmp_zorder); -- cgit v1.2.3