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>


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8647 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
arpi 2002-12-29 21:20:45 +00:00
parent 1cb75ce967
commit b618a7c596
1 changed files with 2 additions and 2 deletions

View File

@ -579,7 +579,7 @@ demuxer_t* demux_open_avi(demuxer_t* demuxer){
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 @@ demuxer_t* demux_open_avi(demuxer_t* demuxer){
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;