[FFmpeg-devel] [PATCH] mov: add option to ignore moov atoms which are detected in free atoms.

liangsi liangsi07 at gmail.com
Wed Oct 12 21:58:30 EEST 2016


---
 libavformat/isom.h | 1 +
 libavformat/mov.c  | 5 ++++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/libavformat/isom.h b/libavformat/isom.h
index 2246fed..6824f7e 100644
--- a/libavformat/isom.h
+++ b/libavformat/isom.h
@@ -214,6 +214,7 @@ typedef struct MOVContext {
     int use_absolute_path;
     int ignore_editlist;
     int ignore_chapters;
+    int ignore_moov_atom_in_free;
     int seek_individually;
     int64_t next_root_atom; ///< offset of the next root atom
     int export_all;
diff --git a/libavformat/mov.c b/libavformat/mov.c
index a15c8d1..1d80c09 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -4848,7 +4848,8 @@ static int mov_read_default(MOVContext *c, AVIOContext *pb, MOVAtom atom)
         if (atom.size >= 8) {
             a.size = avio_rb32(pb);
             a.type = avio_rl32(pb);
-            if (a.type == MKTAG('f','r','e','e') &&
+            if (!c->ignore_moov_atom_in_free && 
+                a.type == MKTAG('f','r','e','e') &&
                 a.size >= 8 &&
                 c->moov_retry) {
                 uint8_t buf[8];
@@ -5926,6 +5927,8 @@ static const AVOption mov_options[] = {
         0, 1, FLAGS},
     {"ignore_chapters", "", OFFSET(ignore_chapters), AV_OPT_TYPE_BOOL, {.i64 = 0},
         0, 1, FLAGS},
+    {"ignore_moov_atom_in_free", "", OFFSET(ignore_moov_atom_in_free), AV_OPT_TYPE_BOOL, 
+        {.i64 = 0}, 0, 1, FLAGS},
     {"use_mfra_for",
         "use mfra for fragment timestamps",
         OFFSET(use_mfra_for), AV_OPT_TYPE_INT, {.i64 = FF_MOV_FLAG_MFRA_AUTO},
-- 
2.8.0.rc3.226.g39d4020



More information about the ffmpeg-devel mailing list