[Mplayer-cvslog] CVS: main/libmpdemux demux_mov.c,1.78,1.79

Arpi of Ize arpi at mplayerhq.hu
Fri Nov 1 00:16:30 CET 2002


Update of /cvsroot/mplayer/main/libmpdemux
In directory mail:/var/tmp.root/cvs-serv6580

Modified Files:
	demux_mov.c 
Log Message:
set up nBlockAlign, nBytesPerSec correctly if extended audio header avail.


Index: demux_mov.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_mov.c,v
retrieving revision 1.78
retrieving revision 1.79
diff -u -r1.78 -r1.79
--- demux_mov.c	31 Oct 2002 19:35:20 -0000	1.78
+++ demux_mov.c	31 Oct 2002 23:16:27 -0000	1.79
@@ -865,7 +865,15 @@
 		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];
-		sh->wf->nAvgBytesPerSec=sh->wf->nChannels*sh->wf->wBitsPerSample*sh->wf->nSamplesPerSec/8;
+		if(trak->stdata_len >= 44 && trak->stdata[9]>=1){
+		//Audio header: samp/pack=4096 bytes/pack=743 bytes/frame=1486 bytes/samp=2
+		  sh->wf->nAvgBytesPerSec=(sh->wf->nChannels*sh->wf->nSamplesPerSec*
+		      char2int(trak->stdata,32)+char2int(trak->stdata,28)/2)
+		      /char2int(trak->stdata,28);
+		  sh->wf->nBlockAlign=char2int(trak->stdata,36);
+		} else {
+		  sh->wf->nAvgBytesPerSec=sh->wf->nChannels*sh->wf->wBitsPerSample*sh->wf->nSamplesPerSec/8;
+		}
 		// Selection:
 		if(demuxer->audio->id==-1 || demuxer->audio->id==priv->track_db){
 		    // (auto)selected audio track:




More information about the MPlayer-cvslog mailing list