mirror of
https://github.com/mpv-player/mpv
synced 2025-03-23 20:00:56 +00: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:
parent
4661006788
commit
c7fde61d42
@ -2920,9 +2920,9 @@ if(rel_seek_secs || abs_seek_pos){
|
|||||||
// get pos from frame number / total frames
|
// get pos from frame number / total frames
|
||||||
guiIntfStruct.Position=(float)d_video->pack_no*100.0f/sh_video->video.dwLength;
|
guiIntfStruct.Position=(float)d_video->pack_no*100.0f/sh_video->video.dwLength;
|
||||||
} else {
|
} else {
|
||||||
int len = ( ( demuxer->movi_end - demuxer->movi_start ) >> 8 );
|
off_t len = ( demuxer->movi_end - demuxer->movi_start );
|
||||||
int pos = ( demuxer->file_format == DEMUXER_TYPE_AUDIO?stream->pos:demuxer->filepos );
|
off_t 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 */ );
|
guiIntfStruct.Position=(len <= 0? 0.0f : ( pos - demuxer->movi_start ) * 100.0f / len );
|
||||||
}
|
}
|
||||||
if ( sh_video ) guiIntfStruct.TimeSec=d_video->pts;
|
if ( sh_video ) guiIntfStruct.TimeSec=d_video->pts;
|
||||||
else if ( sh_audio ) guiIntfStruct.TimeSec=sh_audio->timer;
|
else if ( sh_audio ) guiIntfStruct.TimeSec=sh_audio->timer;
|
||||||
|
Loading…
Reference in New Issue
Block a user