[Mplayer-cvslog] CVS: main/libmpdemux demux_mov.c,1.55,1.56
Atmosfear
atmos4 at mplayer.dev.hu
Sun Mar 24 15:47:30 CET 2002
Update of /cvsroot/mplayer/main/libmpdemux
In directory mplayer:/var/tmp.root/cvs-serv9857/libmpdemux
Modified Files:
demux_mov.c
Log Message:
Use esds parser for movie esds atom and only pass decoder specific configuration into the stream_header.
Index: demux_mov.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_mov.c,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -r1.55 -r1.56
--- demux_mov.c 24 Mar 2002 06:10:12 -0000 1.55
+++ demux_mov.c 24 Mar 2002 14:47:28 -0000 1.56
@@ -669,7 +669,7 @@
// esds atom:
// 28 int atom size (bytes of int size, int type and data)
// 32 char[4] atom type (fourc charater code -> esds)
-// 62 int compressed datarate (Bits)
+// 36 char[] atom data (len=size-8)
sh->samplesize=char2short(trak->stdata,18)/8;
sh->channels=char2short(trak->stdata,16);
@@ -705,7 +705,7 @@
switch(char2int(trak->stdata,32)) { // 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) {
+ if(atom_len > 8) {
esds_t esds;
if(!mp4_parse_esds(&trak->stdata[36], atom_len-8, &esds)) {
@@ -820,8 +820,17 @@
// add code here to save esds header of length atom_len-8
// beginning at stdata[86] to some variable to pass it
// on to the decoder ::atmos
- trak->stream_header=trak->stdata+pos+8;
- trak->stream_header_len=atom_len-8;
+ if(atom_len > 8) {
+ esds_t esds;
+ if(!mp4_parse_esds(trak->stdata+pos+8, atom_len-8, &esds)) {
+
+ // dump away the codec specific configuration for the AAC decoder
+ trak->stream_header_len = esds.decoderConfigLen;
+ trak->stream_header = (unsigned char *)malloc(trak->stream_header_len);
+ memcpy(trak->stream_header, esds.decoderConfig, trak->stream_header_len);
+ }
+ mp4_free_esds(&esds); // freeup esds mem
+ }
break;
default:
mp_msg(MSGT_DEMUX, MSGL_INFO, "MOV: Found unknown movie atom %c%c%c%c (%d)!\n",
@@ -1273,6 +1282,8 @@
demux_packet_t* dp=new_demux_packet(x+trak->stream_header_len);
memcpy(dp->buffer,trak->stream_header,trak->stream_header_len);
stream_read(demuxer->stream,dp->buffer+trak->stream_header_len,x);
+ free(trak->stream_header);
+ trak->stream_header = NULL;
dp->pts=pts;
dp->flags=0;
dp->pos=pos; // FIXME?
More information about the MPlayer-cvslog
mailing list