[Mplayer-cvslog] CVS: 0_90/libmpdemux demux_mov.c,1.94,1.95

Arpi of Ize arpi at mplayerhq.hu
Mon Mar 17 01:54:12 CET 2003


Update of /cvsroot/mplayer/0_90/libmpdemux
In directory mail:/var/tmp.root/cvs-serv23863

Modified Files:
	demux_mov.c 
Log Message:
backport: fixed AAC (mp4a) header parsing, use last video fourcc if variable


Index: demux_mov.c
===================================================================
RCS file: /cvsroot/mplayer/0_90/libmpdemux/demux_mov.c,v
retrieving revision 1.94
retrieving revision 1.95
diff -u -r1.94 -r1.95
--- demux_mov.c	10 Mar 2003 16:08:50 -0000	1.94
+++ demux_mov.c	17 Mar 2003 00:54:10 -0000	1.95
@@ -601,7 +601,10 @@
 		    unsigned int fourcc=stream_read_dword_le(demuxer->stream);
 		    if(len<8) break; // error
 		    mp_msg(MSGT_DEMUX,MSGL_V,"MOV: %*s desc #%d: %.4s  (%d bytes)\n",level,"",i,&fourcc,len-16);
-		    if(!i){
+		    if(fourcc!=trak->fourcc && i)
+			mp_msg(MSGT_DEMUX,MSGL_WARN,MSGTR_MOVvariableFourCC);
+//		    if(!i)
+		    {
 			trak->fourcc=fourcc;
 			// read type specific (audio/video/time/text etc) header
 			// NOTE: trak type is not yet known at this point :(((
@@ -609,8 +612,6 @@
 			trak->stdata=malloc(trak->stdata_len);
 			stream_read(demuxer->stream,trak->stdata,trak->stdata_len);
 		    }
-		    if(fourcc!=trak->fourcc && i)
-			mp_msg(MSGT_DEMUX,MSGL_WARN,MSGTR_MOVvariableFourCC);
 		    if(!stream_seek(demuxer->stream,pos+len)) break;
 		}
 		break;
@@ -902,14 +903,15 @@
 		  }
 		}
 
-		if((trak->stdata[9]==0) && trak->stdata_len >= 36) { // version 0 with extra atoms
-		    int atom_len = char2int(trak->stdata,28);
-		    switch(char2int(trak->stdata,32)) { // atom type
+		if((trak->stdata[9]==0 || trak->stdata[9]==1) && trak->stdata_len >= 36) { // version 0 with extra atoms
+        int adjust = (trak->stdata[9]==1)?48:0;
+		    int atom_len = char2int(trak->stdata,28+adjust);
+		    switch(char2int(trak->stdata,32+adjust)) { // atom type
 		      case MOV_FOURCC('e','s','d','s'): {
 			mp_msg(MSGT_DEMUX, MSGL_INFO, "MOV: Found MPEG4 audio Elementary Stream Descriptor atom (%d)!\n", atom_len);
 			if(atom_len > 8) {
 			  esds_t esds; 				  
-			  if(!mp4_parse_esds(&trak->stdata[36], atom_len-8, &esds)) {
+			  if(!mp4_parse_esds(&trak->stdata[36+adjust], atom_len-8, &esds)) {
 			    
 			    sh->i_bps = esds.avgBitrate/8; 
 
@@ -934,7 +936,7 @@
 		      } break;
 		      default:
 			mp_msg(MSGT_DEMUX, MSGL_INFO, "MOV: Found unknown audio atom %c%c%c%c (%d)!\n",
-			    trak->stdata[32],trak->stdata[33],trak->stdata[34],trak->stdata[35],
+			    trak->stdata[32+adjust],trak->stdata[33+adjust],trak->stdata[34+adjust],trak->stdata[35+adjust],
 			    atom_len);
 		    }
 		}  



More information about the MPlayer-cvslog mailing list