diff --git a/libavformat/isom.c b/libavformat/isom.c index 9df273cf6e77088ee54b5908e0c3567ad9ab1b2c..f20d8568ac04a6f373751e28af8f022fe0307408 100644 --- a/libavformat/isom.c +++ b/libavformat/isom.c @@ -167,6 +167,11 @@ const AVCodecTag codec_movaudio_tags[] = { { CODEC_ID_NONE, 0 }, }; +const AVCodecTag ff_codec_movsubtitle_tags[] = { + { CODEC_ID_TEXT, MKTAG('t', 'e', 'x', 't') }, + { CODEC_ID_NONE, 0 }, +}; + /* map numeric codes from mdhd atom to ISO 639 */ /* cf. QTFileFormat.pdf p253, qtff.pdf p205 */ /* http://developer.apple.com/documentation/mac/Text/Text-368.html */ diff --git a/libavformat/isom.h b/libavformat/isom.h index 5370241288307a3dcc9e38db000d664e4355454b..7a66ce52400120ad0a62ae8b9e7fe36aff73e800 100644 --- a/libavformat/isom.h +++ b/libavformat/isom.h @@ -30,6 +30,7 @@ extern const AVCodecTag ff_mp4_obj_type[]; extern const AVCodecTag codec_movvideo_tags[]; extern const AVCodecTag codec_movaudio_tags[]; +extern const AVCodecTag ff_codec_movsubtitle_tags[]; int ff_mov_iso639_to_lang(const char *lang, int mp4); int ff_mov_lang_to_iso639(int code, char *to); diff --git a/libavformat/mov.c b/libavformat/mov.c index 2b09c78a8e2d3b84bf8d626d139024488e91ba49..7542a01adcb68515e38078d5e01c2fd4b3cfd607 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -624,6 +624,11 @@ static int mov_read_stsd(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom) id = codec_get_id(codec_bmp_tags, format); if (id > 0) st->codec->codec_type = CODEC_TYPE_VIDEO; + else if(st->codec->codec_type == CODEC_TYPE_DATA){ + id = codec_get_id(ff_codec_movsubtitle_tags, format); + if(id > 0) + st->codec->codec_type = CODEC_TYPE_SUBTITLE; + } } dprintf(c->fc, "size=%d 4CC= %c%c%c%c codec_type=%d\n", size,