changeset 2873:3fad6c2f343a libavformat

export raw SSA tracks with their own codec ID (patch by Evgeniy Stepanov)
author aurel
date Sat, 29 Dec 2007 20:49:03 +0000
parents a9bb4614c0f8
children 732885f612e9
files matroska.c matroskadec.c
diffstat 2 files changed, 4 insertions(+), 23 deletions(-) [+]
line wrap: on
line diff
--- a/matroska.c	Sat Dec 29 18:35:38 2007 +0000
+++ b/matroska.c	Sat Dec 29 20:49:03 2007 +0000
@@ -62,10 +62,10 @@
 
     {"S_TEXT/UTF8"      , CODEC_ID_TEXT},
     {"S_TEXT/ASCII"     , CODEC_ID_TEXT},
-    {"S_TEXT/ASS"       , CODEC_ID_TEXT},
-    {"S_TEXT/SSA"       , CODEC_ID_TEXT},
-    {"S_ASS"            , CODEC_ID_TEXT},
-    {"S_SSA"            , CODEC_ID_TEXT},
+    {"S_TEXT/ASS"       , CODEC_ID_SSA},
+    {"S_TEXT/SSA"       , CODEC_ID_SSA},
+    {"S_ASS"            , CODEC_ID_SSA},
+    {"S_SSA"            , CODEC_ID_SSA},
     {"S_VOBSUB"         , CODEC_ID_DVD_SUBTITLE},
 
     {NULL               , CODEC_ID_NONE}
--- a/matroskadec.c	Sat Dec 29 18:35:38 2007 +0000
+++ b/matroskadec.c	Sat Dec 29 20:49:03 2007 +0000
@@ -94,8 +94,6 @@
 
 typedef struct MatroskaSubtitleTrack {
     MatroskaTrack track;
-
-    int ass;
     //..
 } MatroskaSubtitleTrack;
 
@@ -2160,15 +2158,6 @@
                 }
             }
 
-            else if (codec_id == CODEC_ID_TEXT) {
-                MatroskaSubtitleTrack *subtrack=(MatroskaSubtitleTrack *)track;
-                if (!strcmp(track->codec_id, "S_TEXT/ASS") ||
-                    !strcmp(track->codec_id, "S_TEXT/SSA") ||
-                    !strcmp(track->codec_id, "S_ASS") ||
-                    !strcmp(track->codec_id, "S_SSA"))
-                    subtrack->ass = 1;
-            }
-
             if (codec_id == CODEC_ID_NONE) {
                 av_log(matroska->ctx, AV_LOG_INFO,
                        "Unknown/unsupported CodecID %s.\n",
@@ -2438,14 +2427,6 @@
             } else {
                 int offset = 0;
 
-                if (st->codec->codec_id == CODEC_ID_TEXT
-                    && ((MatroskaSubtitleTrack *)(matroska->tracks[track]))->ass) {
-                    int i;
-                    for (i=0; i<8 && data[offset]; offset++)
-                        if (data[offset] == ',')
-                            i++;
-                }
-
                 pkt = av_mallocz(sizeof(AVPacket));
                 /* XXX: prevent data copy... */
                 if (av_new_packet(pkt, lace_size[n]-offset) < 0) {