diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2005-03-04 00:30:18 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2005-03-04 00:30:18 +0000 |
commit | 2f1e1ed3ddc80e3d0f62f4c2ac57b972365b30df (patch) | |
tree | 03fd9bdcf72c18073f8e6ea842407cb208e8ae7a /libavformat/mov.c | |
parent | 3622988f2162e502727da476a70f5e4f48cd19c5 (diff) | |
download | ffmpeg-2f1e1ed3ddc80e3d0f62f4c2ac57b972365b30df.tar.gz |
mp4a fix based on some code by (Song.Itany inventec-inc com)
Originally committed as revision 4002 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/mov.c')
-rw-r--r-- | libavformat/mov.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c index 87acdd419f..afa0a23477 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -1061,8 +1061,12 @@ static int mov_read_stsd(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom) } else if( st->codec.codec_tag == MKTAG( 'm', 'p', '4', 'a' )) { + MOV_atom_t a; + int mp4_version; + /* Handle mp4 audio tag */ - get_be32(pb); /* version */ + mp4_version=get_be16(pb);/*version*/ + get_be16(pb); /*revesion*/ get_be32(pb); st->codec.channels = get_be16(pb); /* channels */ st->codec.bits_per_sample = get_be16(pb); /* bits per sample */ @@ -1070,10 +1074,19 @@ static int mov_read_stsd(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom) st->codec.sample_rate = get_be16(pb); /* sample rate, not always correct */ get_be16(pb); c->mp4=1; - { - MOV_atom_t a = { format, url_ftell(pb), size - (20 + 20 + 8) }; + + if(mp4_version==1) + { + url_fskip(pb,16); + a.size=size-(16+20+16); + } + else + a.size=size-(16+20); + + a.offset=url_ftell(pb); + mov_read_default(c, pb, a); - } + /* Get correct sample rate from extradata */ if(st->codec.extradata_size) { const int samplerate_table[] = { |