[Mplayer-cvslog] CVS: main/libmpdemux demux_avi.c,1.53,1.54

Arpi of Ize arpi at mplayerhq.hu
Sun Dec 29 22:20:50 CET 2002


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

Modified Files:
	demux_avi.c 
Log Message:
fixed these:
- uses video time length instead of audio time length to calculate audio size in fallback
- differences in fallback for priv->numberofframes calculation
patch by eviv bulgroz <ebulgroz at yahoo.com>


Index: demux_avi.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_avi.c,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -r1.53 -r1.54
--- demux_avi.c	21 Dec 2002 22:11:48 -0000	1.53
+++ demux_avi.c	29 Dec 2002 21:20:45 -0000	1.54
@@ -579,7 +579,7 @@
 
     if((priv->numberofframes=sh_video->video.dwLength)<=1)
       // bad video header, try to get number of frames from audio
-      if(sh_audio && sh_audio->wf->nAvgBytesPerSec) priv->numberofframes=sh_video->fps*sh_audio->audio.dwLength/sh_audio->wf->nAvgBytesPerSec;
+      if(sh_audio && sh_audio->wf->nAvgBytesPerSec) priv->numberofframes=sh_video->fps*sh_audio->audio.dwLength/sh_audio->audio.dwRate*sh_audio->audio.dwScale;
     if(priv->numberofframes<=1){
       mp_msg(MSGT_SEEK,MSGL_WARN,MSGTR_CouldntDetFNo);
       priv->numberofframes=0;
@@ -587,7 +587,7 @@
 
     if(sh_audio){
       if(sh_audio->wf->nAvgBytesPerSec && sh_audio->audio.dwSampleSize!=1){
-        asize=sh_audio->wf->nAvgBytesPerSec*priv->numberofframes*sh_video->frametime;
+        asize=(float)sh_audio->wf->nAvgBytesPerSec*sh_audio->audio.dwLength*sh_audio->audio.dwScale/sh_audio->audio.dwRate;
         sh_audio->i_bps=sh_audio->wf->nAvgBytesPerSec;
       } else {
         asize=sh_audio->audio.dwLength;




More information about the MPlayer-cvslog mailing list