Index: libmpdemux/demux_mov.c =================================================================== RCS file: /cvs/mplayer/libmpdemux/demux_mov.c,v retrieving revision 1.1.1.1 diff -u -u -r1.1.1.1 demux_mov.c --- libmpdemux/demux_mov.c 28 Sep 2004 12:32:22 -0000 1.1.1.1 +++ libmpdemux/demux_mov.c 30 Sep 2004 00:25:54 -0000 @@ -863,6 +863,23 @@ sh_audio_t* sh=new_sh_audio(demuxer,priv->track_db); sh->format=trak->fourcc; + switch( sh->format ) { + case 0x726D6173: /* samr */ + /* amr narrowband */ + sh->samplesize=2; + sh->channels=1; + sh->samplerate=8000; + break; + + case 0x62776173: /* sawb */ + /* amr wideband */ + sh->samplesize=2; + sh->channels=1; + sh->samplerate=16000; + break; + + default: + // assumptions for below table: short is 16bit, int is 32bit, intfp is 16bit // XXX: 32bit fixed point numbers (intfp) are only 2 Byte! // short values are usually one byte leftpadded by zero @@ -913,9 +930,9 @@ sh->samplerate = 44100; } } - + } mp_msg(MSGT_DEMUX, MSGL_INFO, "Audio bits: %d chans: %d rate: %d\n", - trak->stdata[19],trak->stdata[17],sh->samplerate); + sh->samplesize*8,sh->channels,sh->samplerate); if(trak->stdata_len >= 44 && trak->stdata[9]>=1){ mp_msg(MSGT_DEMUX,MSGL_V,"Audio header: samp/pack=%d bytes/pack=%d bytes/frame=%d bytes/samp=%d \n", @@ -982,7 +999,7 @@ // Emulate WAVEFORMATEX struct: sh->wf=malloc(sizeof(WAVEFORMATEX)); memset(sh->wf,0,sizeof(WAVEFORMATEX)); - sh->wf->nChannels=(trak->stdata[16]<<8)+trak->stdata[17]; + sh->wf->nChannels=sh->channels; sh->wf->wBitsPerSample=(trak->stdata[18]<<8)+trak->stdata[19]; // sh->wf->nSamplesPerSec=trak->timescale; sh->wf->nSamplesPerSec=(trak->stdata[24]<<8)+trak->stdata[25];