changeset 15022:17915d97622d

Fix alac from QTpro (in standard mov file, not in m4a file) Extradata is in a different place fixes samples/A-codecs/lossless/ALAC/alac.mov
author rtognimp
date Wed, 30 Mar 2005 22:10:07 +0000
parents 0923dd27ddac
children 31ac316c3951
files libmpdemux/demux_mov.c
diffstat 1 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_mov.c	Wed Mar 30 20:34:47 2005 +0000
+++ b/libmpdemux/demux_mov.c	Wed Mar 30 22:10:07 2005 +0000
@@ -950,8 +950,19 @@
 		    int fcc=char2int(trak->stdata,48);
 		    // we have extra audio headers!!!
 		    printf("Audio extra header: len=%d  fcc=0x%X\n",len,fcc);
+		    if((len >= 4) && 
+		       (char2int(trak->stdata,52) >= 12) &&
+		       (char2int(trak->stdata,52+4) == MOV_FOURCC('f','r','m','a')) &&
+		       (char2int(trak->stdata,52+8) == MOV_FOURCC('a','l','a','c')) &&
+		       (len >= 36 + char2int(trak->stdata,52))) {
+			    sh->codecdata_len = char2int(trak->stdata,52+char2int(trak->stdata,52));
+			    mp_msg(MSGT_DEMUX, MSGL_INFO, "MOV: Found alac atom (%d)!\n", sh->codecdata_len);
+			    sh->codecdata = (unsigned char *)malloc(sh->codecdata_len);
+			    memcpy(sh->codecdata, &trak->stdata[52+char2int(trak->stdata,52)], sh->codecdata_len);
+		    } else {
 		    sh->codecdata_len = len-8;
 		    sh->codecdata = trak->stdata+44+8;
+		    }
 		  }
 		}