From 5a89150a4652d987f24d7d386d5cdc6d9109e66d Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 17 Nov 2015 01:54:02 +0100 Subject: player: remove OSD subtitle render path This was used with --no-sub-ass (aka --no-ass). This option (which is not yet removed) strips all styling from the subtitles, and renders them as plaintext only. For some reason, it originally seemed convenient to reuse all the OSD text rendering code (osd_libass.c). While this was indeed simple, it had a bad influence on the rest of the code. For example, it had to decide whether to go through the OSD code path, or the proper subtitle renderer in sd_ass.c. Kill the OSD subtitle renderer. Reimplement --no-sub-ass and also "secondary" subtitles in sd_ass.c. fill_plaintext() contains some rather minor code duplication with osd_libass.c for setting up a dummy ASS_Event and escaping the stripped text. Since sd_ass.c already has to handle "normal" text subtitles, and has code for stripping ASS tags, this remains all relatively simple. Remove all the unnecessary crap from the rest of the code. --- sub/osd.h | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'sub/osd.h') diff --git a/sub/osd.h b/sub/osd.h index 0698ceee5c..6cacf60de4 100644 --- a/sub/osd.h +++ b/sub/osd.h @@ -80,7 +80,7 @@ struct mp_osd_res { enum mp_osdtype { OSDTYPE_SUB, - OSDTYPE_SUB2, + OSDTYPE_SUB2, // IDs must be numerically successive OSDTYPE_PROGBAR, OSDTYPE_OSD, @@ -141,6 +141,7 @@ extern const struct m_sub_options sub_style_conf; struct osd_state; struct osd_object; struct mpv_global; +struct dec_sub; struct osd_state *osd_create(struct mpv_global *global); void osd_changed(struct osd_state *osd, int new_value); @@ -150,12 +151,7 @@ void osd_free(struct osd_state *osd); bool osd_query_and_reset_want_redraw(struct osd_state *osd); void osd_set_text(struct osd_state *osd, int obj, const char *text); - -struct osd_sub_state { - struct dec_sub *dec_sub; - bool render_bitmap_subs; -}; -void osd_set_sub(struct osd_state *osd, int obj, struct osd_sub_state *substate); +void osd_set_sub(struct osd_state *osd, int obj, struct dec_sub *dec_sub); bool osd_get_render_subs_in_filter(struct osd_state *osd); void osd_set_render_subs_in_filter(struct osd_state *osd, bool s); -- cgit v1.2.3