Provide percentage even when demuxer->movi_start and movi_end are not available

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16876 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
reimar 2005-10-30 09:11:40 +00:00
parent 58f108741b
commit 5ecff936b4
1 changed files with 2 additions and 1 deletions

View File

@ -1398,7 +1398,8 @@ if(sh_audio && !demuxer2){
{ float t=(GetTimerMS()-timer_start)*0.001f;
float len=(demuxer->movi_end-demuxer->movi_start);
float p=len>1000 ? (float)(demuxer->filepos-demuxer->movi_start) / len : 0;
float p=len>1000 ? (float)(demuxer->filepos-demuxer->movi_start) / len :
(demuxer_get_percent_pos(demuxer) / 100.0);
#if 0
if(!len && sh_audio && sh_audio->audio.dwLength>100){
p=(sh_audio->audio.dwSampleSize? ds_tell(sh_audio->ds)/sh_audio->audio.dwSampleSize : sh_audio->ds->block_no)