diff options
author | wm4 <wm4@nowhere> | 2016-07-03 18:33:28 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-07-03 19:31:56 +0200 |
commit | f1105528981fc83c5dbf15f1c1d409fb8842a1ea (patch) | |
tree | ad955c1e8a313032b2741b70d446a2fcbb41610a /sub/osd.c | |
parent | 315e2e3da8b5a0d5ff75e438c9c4bbbbc6d53b91 (diff) | |
download | mpv-f1105528981fc83c5dbf15f1c1d409fb8842a1ea.tar.bz2 mpv-f1105528981fc83c5dbf15f1c1d409fb8842a1ea.tar.xz |
sub: pass preferred OSD format to subtitle renderers
The intention is to let mp_ass_packer_pack() produce different output
for the RGBA and LIBASS formats. VOs (or whatever generates the OSD)
currently do not signal a preferred format, and this mechanism just
exists to switch between RGBA and LIBASS formats correctly, preferring
LIBASS if the VO supports it.
Diffstat (limited to 'sub/osd.c')
-rw-r--r-- | sub/osd.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -247,6 +247,10 @@ static void render_object(struct osd_state *osd, struct osd_object *obj, { struct MPOpts *opts = osd->opts; + int format = SUBBITMAP_LIBASS; + if (!sub_formats[format] || opts->force_rgba_osd) + format = SUBBITMAP_RGBA; + bool formats[SUBBITMAP_COUNT]; memcpy(formats, sub_formats, sizeof(formats)); if (opts->force_rgba_osd) @@ -261,7 +265,7 @@ static void render_object(struct osd_state *osd, struct osd_object *obj, double sub_pts = video_pts; if (sub_pts != MP_NOPTS_VALUE) sub_pts -= opts->sub_delay; - sub_get_bitmaps(obj->sub, obj->vo_res, sub_pts, out_imgs); + sub_get_bitmaps(obj->sub, obj->vo_res, format, sub_pts, out_imgs); } } else if (obj->type == OSDTYPE_EXTERNAL2) { if (obj->external2 && obj->external2->format) { @@ -269,7 +273,7 @@ static void render_object(struct osd_state *osd, struct osd_object *obj, obj->external2->change_id = 0; } } else { - osd_object_get_bitmaps(osd, obj, out_imgs); + osd_object_get_bitmaps(osd, obj, format, out_imgs); } if (obj->force_redraw) |