changeset 25656:00e4d59a0be4

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.
author eugeni
date Fri, 11 Jan 2008 21:45:20 +0000
parents e98ceb0190c1
children dfeb8ea2a7a8
files command.c libmpdemux/demuxer.c mpcommon.c
diffstat 3 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- 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 {
--- 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
--- 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);