# HG changeset patch # User michael # Date 1109896218 0 # Node ID fec605ce7d4a752fef55390f38b0d3fab01ff6b6 # Parent 746b44db3a3d4ac080c4b3d8e474b2fe83c1f87a mp4a fix based on some code by (Song.Itany inventec-inc com) diff -r 746b44db3a3d -r fec605ce7d4a mov.c --- a/mov.c Tue Mar 01 02:24:58 2005 +0000 +++ b/mov.c Fri Mar 04 00:30:18 2005 +0000 @@ -1061,8 +1061,12 @@ } 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 @@ 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[] = {