[FFmpeg-devel] [PATCH] add extra codec ID for mov subtitle

Reimar Döffinger Reimar.Doeffinger
Sun Jan 27 17:22:05 CET 2008


Hello,
what I do not know now is, which API version numbers should I increase
for this??

Greetings,
Reimar D?ffinger
-------------- next part --------------
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index bcf9fb6..b51bd52 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -283,6 +283,7 @@ enum CodecID {
     CODEC_ID_TEXT,  ///< raw UTF-8 text
     CODEC_ID_XSUB,
     CODEC_ID_SSA,
+    CODEC_ID_MOV_TEXT,
 
     CODEC_ID_MPEG2TS= 0x20000, /**< _FAKE_ codec to indicate a raw MPEG-2 TS
                                 * stream (only used by libavformat) */
diff --git a/libavformat/isom.c b/libavformat/isom.c
index c0af2d2..5a67aec 100644
--- a/libavformat/isom.c
+++ b/libavformat/isom.c
@@ -169,7 +169,7 @@ const AVCodecTag codec_movaudio_tags[] = {
 };
 
 const AVCodecTag ff_codec_movsubtitle_tags[] = {
-    { CODEC_ID_TEXT, MKTAG('t', 'e', 'x', 't') },
+    { CODEC_ID_MOV_TEXT, MKTAG('t', 'e', 'x', 't') },
     { CODEC_ID_NONE, 0 },
 };
 
diff --git a/libavformat/mov.c b/libavformat/mov.c
index cc3dc70..f39d9a2 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -1543,12 +1543,6 @@ static int mov_read_packet(AVFormatContext *s, AVPacket *pkt)
     } else {
 #endif
         av_get_packet(s->pb, pkt, sample->size);
-        if (s->streams[sc->ffindex]->codec->codec_id == CODEC_ID_TEXT) {
-            int textlen = FFMIN(AV_RB16(pkt->data), sample->size - 2);
-            textlen = FFMAX(textlen, 0);
-            memmove(pkt->data, pkt->data + 2, textlen);
-            pkt->size = textlen;
-        }
 #ifdef CONFIG_DV_DEMUXER
         if (mov->dv_demux) {
             void *pkt_destruct_func = pkt->destruct;



More information about the ffmpeg-devel mailing list