[Mplayer-cvslog] CVS: main mplayer.c,1.539,1.540
Arpi of Ize
arpi at mplayerhq.hu
Mon Aug 5 03:32:14 CEST 2002
Update of /cvsroot/mplayer/main
In directory mail:/var/tmp.root/cvs-serv24733
Modified Files:
mplayer.c
Log Message:
gui seekbar pos calc overflow fixed
Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.539
retrieving revision 1.540
diff -u -r1.539 -r1.540
--- mplayer.c 5 Aug 2002 01:14:12 -0000 1.539
+++ mplayer.c 5 Aug 2002 01:32:11 -0000 1.540
@@ -2920,9 +2920,9 @@
// get pos from frame number / total frames
guiIntfStruct.Position=(float)d_video->pack_no*100.0f/sh_video->video.dwLength;
} else {
- int len = ( ( demuxer->movi_end - demuxer->movi_start ) >> 8 );
- int pos = ( demuxer->file_format == DEMUXER_TYPE_AUDIO?stream->pos:demuxer->filepos );
- guiIntfStruct.Position=(len <= 0? 0.0f : ( pos - demuxer->movi_start ) / len / 2.56f /* / 256.0f * 100.0f */ );
+ off_t len = ( demuxer->movi_end - demuxer->movi_start );
+ off_t pos = ( demuxer->file_format == DEMUXER_TYPE_AUDIO?stream->pos:demuxer->filepos );
+ guiIntfStruct.Position=(len <= 0? 0.0f : ( pos - demuxer->movi_start ) * 100.0f / len );
}
if ( sh_video ) guiIntfStruct.TimeSec=d_video->pts;
else if ( sh_audio ) guiIntfStruct.TimeSec=sh_audio->timer;
More information about the MPlayer-cvslog
mailing list