# HG changeset patch # User arpi # Date 1041196845 0 # Node ID b4c85f36e8fc416ffe7e385815f549ca06c16762 # Parent 8d142510995db5f565bc999db235fb80deda4aaf 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 diff -r 8d142510995d -r b4c85f36e8fc libmpdemux/demux_avi.c --- 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;