aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAurelien Jacobs <aurel@gnuage.org>2007-07-11 13:13:20 +0000
committerAurelien Jacobs <aurel@gnuage.org>2007-07-11 13:13:20 +0000
commitf7e97aaf877fbed5b618798c055603e5d7da5d12 (patch)
tree992be041fc63049143b60c7fa3349f27c9a7782b
parent45da8124a09d0ac5f9d8174884584c5f80309d0c (diff)
downloadffmpeg-f7e97aaf877fbed5b618798c055603e5d7da5d12.tar.gz
add support for Matroska subtitle tracks
Originally committed as revision 9591 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavcodec/avcodec.h1
-rw-r--r--libavformat/matroska.c5
-rw-r--r--libavformat/matroskadec.c6
3 files changed, 8 insertions, 4 deletions
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index ef6ba1db17..e1d3714698 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -262,6 +262,7 @@ enum CodecID {
/* subtitle codecs */
CODEC_ID_DVD_SUBTITLE= 0x17000,
CODEC_ID_DVB_SUBTITLE,
+ CODEC_ID_TEXT,
CODEC_ID_MPEG2TS= 0x20000, /* _FAKE_ codec to indicate a raw MPEG-2 TS
* stream (only used by libavformat) */
diff --git a/libavformat/matroska.c b/libavformat/matroska.c
index d593dea50e..df8d9513ba 100644
--- a/libavformat/matroska.c
+++ b/libavformat/matroska.c
@@ -58,6 +58,11 @@ CodecTags ff_mkv_codec_tags[]={
{"A_REAL/ATRC" , CODEC_ID_ATRAC3},
{"A_REAL/COOK" , CODEC_ID_COOK},
// {"A_REAL/SIPR" , CODEC_ID_SIPRO},
+
+ {"S_TEXT/ASCII" , CODEC_ID_TEXT},
+ {"S_TEXT/UTF8" , CODEC_ID_TEXT},
+ {"S_VOBSUB" , CODEC_ID_DVD_SUBTITLE},
+
{NULL , CODEC_ID_NONE}
/* TODO: AC3-9/10 (?), Real, Musepack, Quicktime */
};
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index d54a867f6e..a38504def9 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -2028,10 +2028,8 @@ matroska_read_header (AVFormatContext *s,
track = matroska->tracks[i];
track->stream_index = -1;
- /* libavformat does not really support subtitles.
- * Also apply some sanity checks. */
- if ((track->type == MATROSKA_TRACK_TYPE_SUBTITLE) ||
- (track->codec_id == NULL))
+ /* Apply some sanity checks. */
+ if (track->codec_id == NULL)
continue;
for(j=0; ff_mkv_codec_tags[j].str; j++){