diff options
author | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2011-01-12 15:15:02 +0200 |
---|---|---|
committer | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2011-01-15 18:45:43 +0200 |
commit | adedee42851d413de87b479340eb015ee33b497b (patch) | |
tree | 14301b035c6d3aecc5c7ddb9eb3d3672806292cb /libmpcodecs/vf_ass.c | |
parent | 43b1de1dd72a9c2f98b3419626c81c58bbc3cf64 (diff) | |
download | mpv-adedee42851d413de87b479340eb015ee33b497b.tar.bz2 mpv-adedee42851d413de87b479340eb015ee33b497b.tar.xz |
subtitles: move global ass_track to struct osd_state
Diffstat (limited to 'libmpcodecs/vf_ass.c')
-rw-r--r-- | libmpcodecs/vf_ass.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/libmpcodecs/vf_ass.c b/libmpcodecs/vf_ass.c index 2678986025..f1a43b52bd 100644 --- a/libmpcodecs/vf_ass.c +++ b/libmpcodecs/vf_ass.c @@ -33,6 +33,7 @@ #include "img_format.h" #include "mp_image.h" #include "vf.h" +#include "libvo/sub.h" #include "libvo/fastmemcpy.h" @@ -59,6 +60,7 @@ static const struct vf_priv_s { // 0 = insert always int auto_insert; + struct osd_state *osd; ASS_Renderer *ass_priv; unsigned char *planes[3]; @@ -68,9 +70,7 @@ static const struct vf_priv_s { } *line_limits; } vf_priv_dflt; -extern ASS_Track *ass_track; extern float sub_delay; -extern int sub_visibility; static int config(struct vf_instance *vf, int width, int height, int d_width, int d_height, @@ -351,9 +351,10 @@ static int render_frame(struct vf_instance *vf, mp_image_t *mpi, static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts) { ASS_Image *images = 0; - if (sub_visibility && vf->priv->ass_priv && ass_track + if (sub_visibility && vf->priv->ass_priv && vf->priv->osd->ass_track && (pts != MP_NOPTS_VALUE)) - images = ass_mp_render_frame(vf->priv->ass_priv, ass_track, + images = ass_mp_render_frame(vf->priv->ass_priv, + vf->priv->osd->ass_track, (pts + sub_delay) * 1000 + .5, NULL); prepare_image(vf, mpi); @@ -377,6 +378,9 @@ static int query_format(struct vf_instance *vf, unsigned int fmt) static int control(vf_instance_t *vf, int request, void *data) { switch (request) { + case VFCTRL_SET_OSD_OBJ: + vf->priv->osd = data; + break; case VFCTRL_INIT_EOSD: vf->priv->ass_priv = ass_renderer_init((ASS_Library *)data); if (!vf->priv->ass_priv) |