changeset 25856:d42e4a4942a4

Simplify subtitle handling with -ass
author reimar
date Sun, 27 Jan 2008 16:36:35 +0000
parents 57a1511f4e76
children 4e593b5b4300
files mpcommon.c
diffstat 1 files changed, 6 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/mpcommon.c	Sun Jan 27 16:13:21 2008 +0000
+++ b/mpcommon.c	Sun Jan 27 16:36:35 2008 +0000
@@ -116,20 +116,17 @@
                 packet += 2;
             }
 #ifdef USE_ASS
-            if (type == 'a' && ass_enabled) { // ssa/ass subs with libass
+            if (ass_enabled) {
                 sh_sub_t* sh = d_dvdsub->sh;
                 ass_track = sh ? sh->ass_track : NULL;
-                if (ass_track)
+                if (!ass_track) continue;
+                if (type == 'a') { // ssa/ass subs with libass
                     ass_process_chunk(ass_track, packet, len,
                                       (long long)(pts*1000 + 0.5),
                                       (long long)((endpts-pts)*1000 + 0.5));
-                continue;
-            }
-            if ((type == 't' || type == 'm') && ass_enabled) { // plaintext subs with libass
-                sh_sub_t* sh = d_dvdsub->sh;
-                ass_track = sh ? sh->ass_track : NULL;
+            } else { // plaintext subs with libass
                 vo_sub = NULL;
-                if (ass_track && pts != MP_NOPTS_VALUE) {
+                if (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);
@@ -137,6 +134,7 @@
                     subs.end = endpts * 100;
                     ass_process_subtitle(ass_track, &subs);
                 }
+            }
                 continue;
             }
 #endif