export raw SSA tracks with their own codec ID (patch by Evgeniy Stepanov)
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>
Sat, 29 Dec 2007 20:49:03 +0000 (20:49 +0000)
committerAurelien Jacobs <aurel@gnuage.org>
Sat, 29 Dec 2007 20:49:03 +0000 (20:49 +0000)
Originally committed as revision 11352 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavcodec/avcodec.h
libavformat/matroska.c
libavformat/matroskadec.c

index 46868ed..bcf9fb6 100644 (file)
@@ -282,6 +282,7 @@ enum CodecID {
     CODEC_ID_DVB_SUBTITLE,
     CODEC_ID_TEXT,  ///< raw UTF-8 text
     CODEC_ID_XSUB,
+    CODEC_ID_SSA,
 
     CODEC_ID_MPEG2TS= 0x20000, /**< _FAKE_ codec to indicate a raw MPEG-2 TS
                                 * stream (only used by libavformat) */
index e541d2d..9b0cc06 100644 (file)
@@ -62,10 +62,10 @@ const CodecTags ff_mkv_codec_tags[]={
 
     {"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}
index 8d201b6..f738115 100644 (file)
@@ -94,8 +94,6 @@ typedef struct MatroskaAudioTrack {
 
 typedef struct MatroskaSubtitleTrack {
     MatroskaTrack track;
-
-    int ass;
     //..
 } MatroskaSubtitleTrack;
 
@@ -2160,15 +2158,6 @@ matroska_read_header (AVFormatContext    *s,
                 }
             }
 
-            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 @@ matroska_parse_block(MatroskaDemuxContext *matroska, uint8_t *data, int size,
             } 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) {