export raw SSA tracks with their own codec ID (patch by Evgeniy Stepanov)

Originally committed as revision 11352 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Evgeniy Stepanov 2007-12-29 20:49:03 +00:00 committed by Aurelien Jacobs
parent 243cc4c34a
commit f9a9b3509c
3 changed files with 5 additions and 23 deletions

View 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) */

View 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}

View 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) {