diff libmpdemux/demux_avi.c @ 8646:b4c85f36e8fc

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@yahoo.com>
author arpi
date Sun, 29 Dec 2002 21:20:45 +0000
parents 71e2ba5d6cdc
children 497e3b284a10
line wrap: on
line diff
--- a/libmpdemux/demux_avi.c	Sun Dec 29 21:08:10 2002 +0000
+++ b/libmpdemux/demux_avi.c	Sun Dec 29 21:20:45 2002 +0000
@@ -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;