changeset 6914:d882c7063e6d

gui seekbar pos calc overflow fixed
author arpi
date Mon, 05 Aug 2002 01:32:11 +0000
parents d5056a166cce
children 5ca9fc4d2994
files mplayer.c
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mplayer.c	Mon Aug 05 01:31:47 2002 +0000
+++ b/mplayer.c	Mon Aug 05 01:32:11 2002 +0000
@@ -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;