aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/mov.c
diff options
context:
space:
mode:
authorBaptiste Coudurier <baptiste.coudurier@smartjog.com>2006-02-18 09:03:22 +0000
committerMichael Niedermayer <michaelni@gmx.at>2006-02-18 09:03:22 +0000
commit4ea28253b6d67bec160a9a53eb924cdc4ecaaea1 (patch)
tree9e9e0851ffc0732f9af6ed15349d4edcb5498777 /libavformat/mov.c
parentcd92221a8dfa9cf2061e179d422961067d97eaf2 (diff)
downloadffmpeg-4ea28253b6d67bec160a9a53eb924cdc4ecaaea1.tar.gz
add mov_read_ftyp to check iso media file type and set c->mp4 patch by (Baptiste COUDURIER <baptiste.coudurier 0 smartjog o com>)
Originally committed as revision 5031 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/mov.c')
-rw-r--r--libavformat/mov.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index c15fd9a47f..3555f6830d 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -629,6 +629,33 @@ static int mov_read_mdat(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)
return 0; /* now go for moov */
}
+static int mov_read_ftyp(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)
+{
+ uint32_t type = get_le32(pb);
+
+ /* from mplayer */
+ switch (type) {
+ case MKTAG('i', 's', 'o', 'm'):
+ case MKTAG('m', 'p', '4', '1'):
+ case MKTAG('m', 'p', '4', '2'):
+ case MKTAG('3', 'g', 'p', '1'):
+ case MKTAG('3', 'g', 'p', '2'):
+ case MKTAG('3', 'g', '2', 'a'):
+ case MKTAG('3', 'g', 'p', '3'):
+ case MKTAG('3', 'g', 'p', '4'):
+ case MKTAG('3', 'g', 'p', '5'):
+ case MKTAG('m', 'm', 'p', '4'): /* Mobile MP4 */
+ case MKTAG('M', '4', 'A', ' '): /* Apple iTunes AAC-LC Audio */
+ case MKTAG('M', '4', 'P', ' '): /* Apple iTunes AAC-LC Protected Audio */
+ c->mp4 = 1;
+ case MKTAG('q', 't', ' ', ' '):
+ av_log(c->fc, AV_LOG_DEBUG, "ISO: File Type Major Brand: %.4s\n",(char *)&type);
+ }
+ get_be32(pb); /* minor version */
+ url_fskip(pb, atom.size - 8);
+ return 0;
+}
+
/* this atom should contain all header atoms */
static int mov_read_moov(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)
{
@@ -1477,6 +1504,7 @@ static const MOVParseTableEntry mov_default_parse_table[] = {
{ MKTAG( 'e', 'd', 't', 's' ), mov_read_default },
{ MKTAG( 'e', 'l', 's', 't' ), mov_read_elst },
{ MKTAG( 'f', 'r', 'e', 'e' ), mov_read_leaf },
+{ MKTAG( 'f', 't', 'y', 'p' ), mov_read_ftyp },
{ MKTAG( 'h', 'd', 'l', 'r' ), mov_read_hdlr },
{ MKTAG( 'h', 'i', 'n', 't' ), mov_read_leaf },
{ MKTAG( 'h', 'm', 'h', 'd' ), mov_read_leaf },