1
mirror of https://github.com/mpv-player/mpv synced 2025-01-05 03:06:28 +01:00

gui seekbar pos calc overflow fixed

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@6915 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
arpi 2002-08-05 01:32:11 +00:00
parent 4661006788
commit c7fde61d42

View File

@ -2920,9 +2920,9 @@ if(rel_seek_secs || abs_seek_pos){
// 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;