summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--command.c2
-rw-r--r--libmpdemux/demuxer.c3
-rw-r--r--mpcommon.c7
3 files changed, 6 insertions, 6 deletions
diff --git a/command.c b/command.c
index 8f84be2c65..892eb6740d 100644
--- a/command.c
+++ b/command.c
@@ -1483,7 +1483,7 @@ static int mp_property_sub(m_option_t * prop, int action, void *arg,
if (sh->type == 'v')
init_vo_spudec();
#ifdef USE_ASS
- else if (ass_enabled && sh->type == 'a')
+ else if (ass_enabled && (sh->type == 'a' || sh->type == 't'))
ass_track = sh->ass_track;
#endif
} else {
diff --git a/libmpdemux/demuxer.c b/libmpdemux/demuxer.c
index 512178915d..2bf76199fc 100644
--- a/libmpdemux/demuxer.c
+++ b/libmpdemux/demuxer.c
@@ -827,7 +827,8 @@ int biComp=le2me_32(sh_video->bih->biCompression);
sh->ass_track = ass_new_track(ass_library);
if (sh->ass_track && sh->extradata)
ass_process_codec_private(sh->ass_track, sh->extradata, sh->extradata_len);
- }
+ } else if (sh && sh->type == 't')
+ sh->ass_track = ass_default_track(ass_library);
}
}
#endif
diff --git a/mpcommon.c b/mpcommon.c
index 2bc3d39aeb..1d1578c4e1 100644
--- a/mpcommon.c
+++ b/mpcommon.c
@@ -120,11 +120,10 @@ void update_subtitles(sh_video_t *sh_video, demux_stream_t *d_dvdsub, int reset)
continue;
}
if (type == 't' && ass_enabled) { // plaintext subs with libass
- static ass_track_t *global_ass_track = NULL;
- if (!global_ass_track) global_ass_track = ass_default_track(ass_library);
- ass_track = global_ass_track;
+ sh_sub_t* sh = d_dvdsub->sh;
+ ass_track = sh ? sh->ass_track : NULL;
vo_sub = NULL;
- if (pts != MP_NOPTS_VALUE) {
+ if (ass_track && pts != MP_NOPTS_VALUE) {
if (endpts == MP_NOPTS_VALUE) endpts = pts + 3;
sub_clear_text(&subs, MP_NOPTS_VALUE);
sub_add_text(&subs, packet, len, endpts);