From f562a41ca2abb7efe5fbb40954fb29f5db99f874 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 14 May 2013 23:14:23 +0200 Subject: command: simplify sub OSD update We can just update all OSD elements in these cases. This way we can also reuse it for commands which need to update the OSD for other reasons. --- sub/sub.c | 8 +++----- sub/sub.h | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) (limited to 'sub') diff --git a/sub/sub.c b/sub/sub.c index e9496f7853..7111f39434 100644 --- a/sub/sub.c +++ b/sub/sub.c @@ -313,10 +313,8 @@ void vo_osd_changed(int new_value) osd->want_redraw = true; } -void osd_subs_changed(struct osd_state *osd) +void osd_changed_all(struct osd_state *osd) { - for (int n = 0; n < MAX_OSD_PARTS; n++) { - if (osd->objs[n]->is_sub) - vo_osd_changed(n); - } + for (int n = 0; n < MAX_OSD_PARTS; n++) + vo_osd_changed(n); } diff --git a/sub/sub.h b/sub/sub.h index f062b3dddf..779d46c869 100644 --- a/sub/sub.h +++ b/sub/sub.h @@ -207,7 +207,7 @@ extern float sub_fps; struct osd_state *osd_create(struct MPOpts *opts, struct ass_library *asslib); void osd_set_text(struct osd_state *osd, const char *text); void vo_osd_changed(int new_value); -void osd_subs_changed(struct osd_state *osd); +void osd_changed_all(struct osd_state *osd); void osd_free(struct osd_state *osd); enum mp_osd_draw_flags { -- cgit v1.2.3