[FFmpeg-devel] [PATCH] Support FLIC in MOV.

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sat Mar 24 20:29:10 CET 2012


Fixes trac issue #626.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger at gmx.de>
---
 libavcodec/flicvideo.c |   10 +++++++---
 libavformat/isom.c     |    1 +
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/libavcodec/flicvideo.c b/libavcodec/flicvideo.c
index 0434261..c5df949 100644
--- a/libavcodec/flicvideo.c
+++ b/libavcodec/flicvideo.c
@@ -83,7 +83,8 @@ static av_cold int flic_decode_init(AVCodecContext *avctx)
     unsigned char *fli_header = (unsigned char *)avctx->extradata;
     int depth;
 
-    if (avctx->extradata_size != 12 &&
+    if (avctx->extradata_size != 0 &&
+        avctx->extradata_size != 12 &&
         avctx->extradata_size != 128) {
         av_log(avctx, AV_LOG_ERROR, "Expected extradata of 12 or 128 bytes\n");
         return AVERROR_INVALIDDATA;
@@ -91,13 +92,16 @@ static av_cold int flic_decode_init(AVCodecContext *avctx)
 
     s->avctx = avctx;
 
-    s->fli_type = AV_RL16(&fli_header[4]); /* Might be overridden if a Magic Carpet FLC */
-
     if (s->avctx->extradata_size == 12) {
         /* special case for magic carpet FLIs */
         s->fli_type = FLC_MAGIC_CARPET_SYNTHETIC_TYPE_CODE;
         depth = 8;
+    } else if (avctx->extradata_size == 0) {
+        /* FLI in MOV, see e.g. FFmpeg trac issue #626 */
+        s->fli_type = FLI_TYPE_CODE;
+        depth = 8;
     } else {
+        s->fli_type = AV_RL16(&fli_header[4]);
         depth = AV_RL16(&fli_header[12]);
     }
 
diff --git a/libavformat/isom.c b/libavformat/isom.c
index f12ba2c..04e3f3f 100644
--- a/libavformat/isom.c
+++ b/libavformat/isom.c
@@ -231,6 +231,7 @@ const AVCodecTag ff_codec_movvideo_tags[] = {
     { CODEC_ID_PRORES, MKTAG('a', 'p', 'c', 's') }, /* Apple ProRes 422 LT */
     { CODEC_ID_PRORES, MKTAG('a', 'p', 'c', 'o') }, /* Apple ProRes 422 Proxy */
     { CODEC_ID_PRORES, MKTAG('a', 'p', '4', 'h') }, /* Apple ProRes 4444 */
+    { CODEC_ID_FLIC,   MKTAG('f', 'l', 'i', 'c') },
 
     { CODEC_ID_NONE, 0 },
 };
-- 
1.7.9.1



More information about the ffmpeg-devel mailing list