[FFmpeg-devel] [PATCH]Read chan atom in mov

Carl Eugen Hoyos cehoyos at ag.or.at
Thu Apr 28 00:56:04 CEST 2011


Hi!

Attached allows to read the channel atom from mov files.

Please comment, Carl Eugen
-------------- next part --------------
diff --git a/libavformat/mov.c b/libavformat/mov.c
index a44182a..2cff927 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -33,6 +33,7 @@
 #include "riff.h"
 #include "isom.h"
 #include "libavcodec/get_bits.h"
+#include "caf.h"
 
 #if CONFIG_ZLIB
 #include <zlib.h>
@@ -2180,6 +2181,15 @@ static int mov_read_elst(MOVContext *c, AVIOContext *pb, MOVAtom atom)
     return 0;
 }
 
+static int mov_read_chan(MOVContext *c, AVIOContext *pb, MOVAtom atom)
+{
+    if (atom.size < 16)
+        return AVERROR_INVALIDDATA;
+    avio_skip(pb, 4);
+    ff_read_chan_chunk(c->fc, atom.size - 4, c->fc->streams[0]->codec);
+    return 0;
+}
+
 static const MOVParseTableEntry mov_default_parse_table[] = {
 { MKTAG('a','v','s','s'), mov_read_extradata },
 { MKTAG('c','h','p','l'), mov_read_chpl },
@@ -2233,6 +2243,7 @@ static const MOVParseTableEntry mov_default_parse_table[] = {
 { MKTAG('d','a','c','3'), mov_read_dac3 }, /* AC-3 info */
 { MKTAG('w','i','d','e'), mov_read_wide }, /* place holder */
 { MKTAG('c','m','o','v'), mov_read_cmov },
+{ MKTAG('c','h','a','n'), mov_read_chan },
 { 0, NULL }
 };
 


More information about the ffmpeg-devel mailing list