[FFmpeg-cvslog] r11624 - in trunk/libavformat: isom.c isom.h mov.c

michael subversion
Sat Jan 26 21:30:03 CET 2008


Author: michael
Date: Sat Jan 26 21:30:03 2008
New Revision: 11624

Log:
Set codec type and id correct for text subtitles.
fixes http://samples.mplayerhq.hu/mov/subtitles-embedded/subtitlemovie.mov
closes issue341


Modified:
   trunk/libavformat/isom.c
   trunk/libavformat/isom.h
   trunk/libavformat/mov.c

Modified: trunk/libavformat/isom.c
==============================================================================
--- trunk/libavformat/isom.c	(original)
+++ trunk/libavformat/isom.c	Sat Jan 26 21:30:03 2008
@@ -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 */

Modified: trunk/libavformat/isom.h
==============================================================================
--- trunk/libavformat/isom.h	(original)
+++ trunk/libavformat/isom.h	Sat Jan 26 21:30:03 2008
@@ -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);

Modified: trunk/libavformat/mov.c
==============================================================================
--- trunk/libavformat/mov.c	(original)
+++ trunk/libavformat/mov.c	Sat Jan 26 21:30:03 2008
@@ -624,6 +624,11 @@ static int mov_read_stsd(MOVContext *c, 
                 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,




More information about the ffmpeg-cvslog mailing list