changeset 690:fec605ce7d4a libavformat

mp4a fix based on some code by (Song.Itany inventec-inc com)
author michael
date Fri, 04 Mar 2005 00:30:18 +0000
parents 746b44db3a3d
children 28af25a9a897
files mov.c
diffstat 1 files changed, 17 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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[] = {