From 5fc5ae752bfaa6bddf76aa1912b4b9724578f5dd Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 28 Sep 2012 21:48:30 +0200 Subject: sub: allow converting DVD subs to RGBA The mplayer DVD sub decoder is the only remaining OSD image producer that still requires the old mplayer OSD format (SUBBITMAP_OLD_PLANAR). To make supporting this format optional in VOs, add a step that allows converting these images to RGBA in case the VO doesn't have direct support for it. Note: the mplayer DVD sub decoder uses the old mplayer OSD format (SUBBITMAP_OLD_PLANAR), which is assumed to use premultiplied alpha. However, it seems DVDs allow only binary transparency, so the rendered result will be the same. --- sub/sub.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'sub/sub.c') diff --git a/sub/sub.c b/sub/sub.c index 3f1b08c185..182215310f 100644 --- a/sub/sub.c +++ b/sub/sub.c @@ -210,6 +210,10 @@ static bool render_object(struct osd_state *osd, struct osd_object *obj, cached |= osd_conv_old_p_to_old(obj->cache[1], out_imgs); } + if (formats[SUBBITMAP_RGBA] && out_imgs->format == SUBBITMAP_OLD_PLANAR) { + cached |= osd_conv_old_p_to_rgba(obj->cache[2], out_imgs); + } + if (cached) obj->cached = *out_imgs; -- cgit v1.2.3