Browse Source

Set correct codec type and id for text subtitles.

fixes http://samples.mplayerhq.hu/mov/subtitles-embedded/subtitlemovie.mov
closes issue341

Originally committed as revision 11624 to svn://svn.ffmpeg.org/ffmpeg/trunk
tags/v0.5
Michael Niedermayer 18 years ago
parent
commit
1e3c9307e6
3 changed files with 11 additions and 0 deletions
  1. +5
    -0
      libavformat/isom.c
  2. +1
    -0
      libavformat/isom.h
  3. +5
    -0
      libavformat/mov.c

+ 5
- 0
libavformat/isom.c View File

@@ -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 */


+ 1
- 0
libavformat/isom.h View File

@@ -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);


+ 5
- 0
libavformat/mov.c View File

@@ -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,


Loading…
Cancel
Save