summaryrefslogtreecommitdiffstats
path: root/mplayer.c
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2011-01-12 15:15:02 +0200
committerUoti Urpala <uau@glyph.nonexistent.invalid>2011-01-15 18:45:43 +0200
commitadedee42851d413de87b479340eb015ee33b497b (patch)
tree14301b035c6d3aecc5c7ddb9eb3d3672806292cb /mplayer.c
parent43b1de1dd72a9c2f98b3419626c81c58bbc3cf64 (diff)
downloadmpv-adedee42851d413de87b479340eb015ee33b497b.tar.bz2
mpv-adedee42851d413de87b479340eb015ee33b497b.tar.xz
subtitles: move global ass_track to struct osd_state
Diffstat (limited to 'mplayer.c')
-rw-r--r--mplayer.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/mplayer.c b/mplayer.c
index 091287c1fd..f36bb2788f 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -335,9 +335,6 @@ int subcc_enabled=0;
int suboverlap_enabled = 1;
#include "ass_mp.h"
-#ifdef CONFIG_ASS
-ASS_Track *ass_track = 0; // current track to render
-#endif
char* current_module=NULL; // for debugging
@@ -1949,10 +1946,10 @@ void update_subtitles(struct MPContext *mpctx, double refpts,
#ifdef CONFIG_ASS
if (opts->ass_enabled) {
sh_sub_t* sh = d_sub->sh;
- ass_track = sh ? sh->ass_track : NULL;
- if (!ass_track) continue;
+ mpctx->osd->ass_track = sh ? sh->ass_track : NULL;
+ if (!mpctx->osd->ass_track) continue;
if (type == 'a') { // ssa/ass subs with libass
- ass_process_chunk(ass_track, packet, len,
+ ass_process_chunk(mpctx->osd->ass_track, packet, len,
(long long)(subpts*1000 + 0.5),
(long long)((endpts-subpts)*1000 + 0.5));
} else { // plaintext subs with libass
@@ -1962,7 +1959,7 @@ void update_subtitles(struct MPContext *mpctx, double refpts,
sub_add_text(&tmp_subs, packet, len, endpts);
tmp_subs.start = subpts * 100;
tmp_subs.end = endpts * 100;
- ass_process_subtitle(ass_track, &tmp_subs);
+ ass_process_subtitle(mpctx->osd->ass_track, &tmp_subs);
sub_clear_text(&tmp_subs, MP_NOPTS_VALUE);
}
}
@@ -3416,7 +3413,7 @@ static void run_playloop(struct MPContext *mpctx)
update_teletext(sh_video, mpctx->demuxer, 0);
update_osd_msg(mpctx);
struct vf_instance *vf = sh_video->vfilter;
- vf->control(vf, VFCTRL_DRAW_EOSD, NULL);
+ vf->control(vf, VFCTRL_DRAW_EOSD, mpctx->osd);
vf->control(vf, VFCTRL_DRAW_OSD, mpctx->osd);
vo_osd_changed(0);
@@ -4944,7 +4941,7 @@ if(mpctx->set_of_sub_size > 0) {
mpctx->vo_sub_last = vo_sub=NULL;
mpctx->subdata=NULL;
#ifdef CONFIG_ASS
-ass_track = NULL;
+mpctx->osd->ass_track = NULL;
if(ass_library)
ass_clear_fonts(ass_library);
#endif