From 17f5019b468d5269408b7dae53a24e17426de7d5 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 4 Oct 2012 17:16:32 +0200 Subject: sub: always go through sub.c for OSD rendering Before this commit, vf_vo.c and vf_ass.c were manually calling the subtitle decoder to retrieve images to render. In particular, this circumvented the sub-bitmap conversion & caching layer in sub.c. Change this so that subtitle decoding isn't special anymore, and draws all subtitles with the normal OSD drawing API. This is also a step towards removing the need for vf_ass auto-insertion. In fact, if auto-insertion would be disabled now, VOs with "old" OSD rendering could still render ASS subtitles in monochrome, because there is still ASS -> old-OSD bitmap conversion in the sub.c mechanism. The code is written with the assumption that the subtitle rendering filter (vf_ass) can render all subtitle formats. Since vf_ass knows the ASS format only, rendering image subs (i.e. RGBA subs) with it simply fails. This means that with vo_xv (vf_ass auto-inserted), image subs wouldn't be rendered. Use a dumb hack to disable rendering subs with a filter, if we detect that the subs are not in ASS format. (Trying to render the subs first would probably result in purging the conversion cache on every frame.) --- sub/dec_sub.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'sub/dec_sub.h') diff --git a/sub/dec_sub.h b/sub/dec_sub.h index 9c75506c4c..7ccf513438 100644 --- a/sub/dec_sub.h +++ b/sub/dec_sub.h @@ -60,6 +60,15 @@ typedef struct sub_bitmaps { int bitmap_id, bitmap_pos_id; } mp_eosd_images_t; +struct sub_render_params { + double pts; + struct mp_eosd_res dim; + double normal_scale; + double vsfilter_scale; + + bool support_rgba; +}; + static inline bool is_text_sub(int type) { return type == 't' || type == 'm' || type == 'a'; -- cgit v1.2.3