diff options
author | wm4 <wm4@nowhere> | 2013-12-24 17:46:14 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-12-24 17:46:14 +0100 |
commit | 3720b3f17d4951ab839418b5cbfd1a85eb74adba (patch) | |
tree | 819b311b4c224ba2fd3dcd0efe8008a83f2cc938 /sub/osd_libass.c | |
parent | 9292f537d661af16321fd35eb0016e830594863b (diff) | |
download | mpv-3720b3f17d4951ab839418b5cbfd1a85eb74adba.tar.bz2 mpv-3720b3f17d4951ab839418b5cbfd1a85eb74adba.tar.xz |
player: add --secondary-sid for displaying a second subtitle stream
This is relatively hacky, but it's Christmas, so it's ok. This does two
things: 1. allow selecting two subtitle tracks, and 2. include a hack
that renders the second subtitle always as toptitle. See manpage
additions how to use this.
Diffstat (limited to 'sub/osd_libass.c')
-rw-r--r-- | sub/osd_libass.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sub/osd_libass.c b/sub/osd_libass.c index 48083bc71f..e43408829b 100644 --- a/sub/osd_libass.c +++ b/sub/osd_libass.c @@ -411,7 +411,7 @@ static void update_sub(struct osd_state *osd, struct osd_object *obj) clear_obj(obj); - if (!osd->sub_text || !osd->sub_text[0]) + if (!obj->sub_text || !obj->sub_text[0] || obj->render_bitmap_subs) return; create_ass_renderer(osd, obj); @@ -423,12 +423,14 @@ static void update_sub(struct osd_state *osd, struct osd_object *obj) ASS_Style *style = obj->osd_track->styles + obj->osd_track->default_style; mp_ass_set_style(style, obj->osd_track->PlayResY, &font); + if (obj->type == OSDTYPE_SUB2) + style->Alignment = 6; #if LIBASS_VERSION >= 0x01010000 ass_set_line_position(obj->osd_render, 100 - opts->sub_pos); #endif - char *escaped_text = mangle_ass(osd->sub_text); + char *escaped_text = mangle_ass(obj->sub_text); add_osd_ass_event(obj->osd_track, escaped_text); talloc_free(escaped_text); } @@ -439,7 +441,8 @@ static void update_object(struct osd_state *osd, struct osd_object *obj) case OSDTYPE_OSD: update_osd(osd, obj); break; - case OSDTYPE_SUBTEXT: + case OSDTYPE_SUB: + case OSDTYPE_SUB2: update_sub(osd, obj); break; case OSDTYPE_PROGBAR: |