# HG changeset patch # User eugeni # Date 1200087920 0 # Node ID 00e4d59a0be45ea0fb2fff820200018ba618c081 # Parent e98ceb0190c19fd22910417466cbbf99fe9e6d4f Remove global_ass_track. Instead create an ass_track for each 't' track. Global_ass_track obviously can not work when there is more than one 't tracks, their lines will be mixed up. diff -r e98ceb0190c1 -r 00e4d59a0be4 command.c --- a/command.c Fri Jan 11 21:45:17 2008 +0000 +++ b/command.c Fri Jan 11 21:45:20 2008 +0000 @@ -1483,7 +1483,7 @@ 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 -r e98ceb0190c1 -r 00e4d59a0be4 libmpdemux/demuxer.c --- a/libmpdemux/demuxer.c Fri Jan 11 21:45:17 2008 +0000 +++ b/libmpdemux/demuxer.c Fri Jan 11 21:45:20 2008 +0000 @@ -827,7 +827,8 @@ 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 -r e98ceb0190c1 -r 00e4d59a0be4 mpcommon.c --- a/mpcommon.c Fri Jan 11 21:45:17 2008 +0000 +++ b/mpcommon.c Fri Jan 11 21:45:20 2008 +0000 @@ -120,11 +120,10 @@ 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);