[MPlayer-cvslog] r25684 - in trunk: command.c libmpdemux/demuxer.c mpcommon.c

eugeni subversion at mplayerhq.hu
Fri Jan 11 22:45:20 CET 2008


Author: eugeni
Date: Fri Jan 11 22:45:20 2008
New Revision: 25684

Log:
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.


Modified:
   trunk/command.c
   trunk/libmpdemux/demuxer.c
   trunk/mpcommon.c

Modified: trunk/command.c
==============================================================================
--- trunk/command.c	(original)
+++ trunk/command.c	Fri Jan 11 22:45:20 2008
@@ -1483,7 +1483,7 @@ static int mp_property_sub(m_option_t * 
 		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 {

Modified: trunk/libmpdemux/demuxer.c
==============================================================================
--- trunk/libmpdemux/demuxer.c	(original)
+++ trunk/libmpdemux/demuxer.c	Fri Jan 11 22:45:20 2008
@@ -827,7 +827,8 @@ int biComp=le2me_32(sh_video->bih->biCom
        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

Modified: trunk/mpcommon.c
==============================================================================
--- trunk/mpcommon.c	(original)
+++ trunk/mpcommon.c	Fri Jan 11 22:45:20 2008
@@ -120,11 +120,10 @@ void update_subtitles(sh_video_t *sh_vid
                 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);



More information about the MPlayer-cvslog mailing list