summaryrefslogtreecommitdiffstats
path: root/sub/sub.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-04-28 21:12:11 +0200
committerwm4 <wm4@nowhere>2013-05-30 22:20:02 +0200
commitb44202b69fc4a1dd1659f7940c5f8846d316e0ff (patch)
treecba363991fc52000ec3f02b9ade2d94e56af873e /sub/sub.h
parentf7ad81c0f5905637c16480b2e44dd41f2839293a (diff)
downloadmpv-b44202b69fc4a1dd1659f7940c5f8846d316e0ff.tar.bz2
mpv-b44202b69fc4a1dd1659f7940c5f8846d316e0ff.tar.xz
sub: redo how -no-ass is handled
The -no-ass switch used to disable any use of libass for text subtitles. This is not really the case anymore, because libass is now always involved when rendering text. The only remaining use of -no-ass is disabling styling or showing subtitles on the terminal. On the other hand, the old subtitle rendering path is a big reason why the subtitle code is still a big mess with an awful number of obscure special cases. In order to simplify it, remove the old subtitle rendering code, and always go through sd_ass.c. Basically, we use ASS_Track as central data structure for storing text subtitles instead of struct sub_data. This also makes libass mandatory for all text subs, even if they are printed to the terminal in -no-video mode. (We could add something like sd_text to avoid this, but it's not worth the trouble.) struct sub_data and subreader.c are still around, even its ASS/SSA reader. But struct sub_data is freed right after converting it to ASS_Track. The internal ASS reader actually can handle some obscure cases libass can't, like files encoded in UTF-16.
Diffstat (limited to 'sub/sub.h')
-rw-r--r--sub/sub.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/sub/sub.h b/sub/sub.h
index 779d46c869..a922d2b162 100644
--- a/sub/sub.h
+++ b/sub/sub.h
@@ -85,7 +85,7 @@ struct mp_osd_res {
enum mp_osdtype {
OSDTYPE_SUB,
- OSDTYPE_SUBTITLE,
+ OSDTYPE_SUBTEXT,
OSDTYPE_SPU,
OSDTYPE_PROGBAR,
@@ -126,11 +126,14 @@ struct osd_state {
double vo_pts;
bool render_subs_in_filter;
+ bool render_bitmap_subs;
bool want_redraw;
// OSDTYPE_OSD
char *osd_text;
+ // OSDTYPE_SUBTEXT
+ char *sub_text;
// OSDTYPE_PROGBAR
int progbar_type; // <0: disabled, 1-255: symbol, else: no symbol
float progbar_value; // range 0.0-1.0
@@ -149,8 +152,6 @@ struct osd_state {
struct ass_library *osd_ass_library;
};
-extern struct subtitle* vo_sub;
-
extern void* vo_spudec;
extern void* vo_vobsub;
@@ -206,6 +207,7 @@ extern float sub_fps;
struct osd_state *osd_create(struct MPOpts *opts, struct ass_library *asslib);
void osd_set_text(struct osd_state *osd, const char *text);
+void osd_set_sub(struct osd_state *osd, const char *text);
void vo_osd_changed(int new_value);
void osd_changed_all(struct osd_state *osd);
void osd_free(struct osd_state *osd);