[Mplayer-cvslog] CVS: main/libmpdemux demux_mov.c,1.107,1.108

Roberto Togni CVS syncmail at mplayerhq.hu
Mon Sep 13 23:21:50 CEST 2004


CVS change done by Roberto Togni CVS

Update of /cvsroot/mplayer/main/libmpdemux
In directory mail:/var2/tmp/cvs-serv9476/libmpdemux

Modified Files:
	demux_mov.c 
Log Message:
AVC support moved to libavcodec, avcC atom is now passed in extradata


Index: demux_mov.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_mov.c,v
retrieving revision 1.107
retrieving revision 1.108
diff -u -r1.107 -r1.108
--- demux_mov.c	29 Aug 2004 13:52:19 -0000	1.107
+++ demux_mov.c	13 Sep 2004 21:21:47 -0000	1.108
@@ -1117,14 +1117,14 @@
 		      if(atom_len > 8) {
 		        int i, poffs, cnt;
 		        // Parse some parts of avcC, just for fun :)
-		        // avcC formatting happens in vd_ffmpeg, sps and pps are decoded in lavc
+		        // real parsing is done by avc1 decoder
 		        mp_msg(MSGT_DEMUX, MSGL_V, "MOV: avcC version: %d\n", *(trak->stdata+pos+8));
 		        if (*(trak->stdata+pos+8) != 1)
 		          mp_msg(MSGT_DEMUX, MSGL_ERR, "MOV: unknown avcC version (%d). Expexct problems.\n", *(trak->stdata+pos+9));
 		        mp_msg(MSGT_DEMUX, MSGL_V, "MOV: avcC profile: %d\n", *(trak->stdata+pos+9));
 		        mp_msg(MSGT_DEMUX, MSGL_V, "MOV: avcC profile compatibility: %d\n", *(trak->stdata+pos+10));
 		        mp_msg(MSGT_DEMUX, MSGL_V, "MOV: avcC level: %d\n", *(trak->stdata+pos+11));
-		        mp_msg(MSGT_DEMUX, MSGL_V, "MOV: avcC nal length size: %d\n", (*(trak->stdata+pos+12))&0x03+1);
+		        mp_msg(MSGT_DEMUX, MSGL_V, "MOV: avcC nal length size: %d\n", ((*(trak->stdata+pos+12))&0x03)+1);
 		        mp_msg(MSGT_DEMUX, MSGL_V, "MOV: avcC number of sequence param sets: %d\n", cnt = (*(trak->stdata+pos+13) & 0x1f));
 		        poffs = pos + 14;
 		        for (i = 0; i < cnt; i++) {
@@ -1138,7 +1138,7 @@
 		          poffs += BE_16(trak->stdata+poffs) + 2;
 		        }
 		        // Copy avcC for the AVC decoder
-		        // This data will be sent to decoder with first frame, before frame data
+		        // This data will be put in extradata below, where BITMAPINFOHEADER is created
 		        trak->stream_header_len = atom_len-8;
 		        trak->stream_header = (unsigned char *)malloc(trak->stream_header_len);
 		        memcpy(trak->stream_header, trak->stdata+pos+8, trak->stream_header_len);
@@ -1269,9 +1269,19 @@
 		}
 		else
 		{
+		 if (trak->fourcc == mmioFOURCC('a','v','c','1')) {
+		  sh->bih=malloc(sizeof(BITMAPINFOHEADER) + trak->stream_header_len);
+		  memset(sh->bih,0,sizeof(BITMAPINFOHEADER) + trak->stream_header_len);
+		  sh->bih->biSize=40  + trak->stream_header_len;
+		  memcpy(((unsigned char *)sh->bih)+40,  trak->stream_header, trak->stream_header_len);
+		  free (trak->stream_header);
+		  trak->stream_header_len = 0;
+		  trak->stream_header = NULL;
+		 } else {
 		  sh->bih=malloc(sizeof(BITMAPINFOHEADER));
 		  memset(sh->bih,0,sizeof(BITMAPINFOHEADER));
 		  sh->bih->biSize=40;
+		 }
 		}
 		sh->bih->biWidth=sh->disp_w;
 		sh->bih->biHeight=sh->disp_h;




More information about the MPlayer-cvslog mailing list