Mercurial > mplayer.hg
comparison mplayer.c @ 22808:c9b6a804f753
Gui: Allow progress bar to move when playing mov or mp4 files
author | cehoyos |
---|---|
date | Mon, 26 Mar 2007 09:26:02 +0000 |
parents | 3d83d77f5a6b |
children | 98eaf29b5dee |
comparison
equal
deleted
inserted
replaced
22807:499738cca90b | 22808:c9b6a804f753 |
---|---|
3553 guiEventHandling(); | 3553 guiEventHandling(); |
3554 if(mpctx->demuxer->file_format==DEMUXER_TYPE_AVI && mpctx->sh_video && mpctx->sh_video->video.dwLength>2){ | 3554 if(mpctx->demuxer->file_format==DEMUXER_TYPE_AVI && mpctx->sh_video && mpctx->sh_video->video.dwLength>2){ |
3555 // get pos from frame number / total frames | 3555 // get pos from frame number / total frames |
3556 guiIntfStruct.Position=(float)mpctx->d_video->pack_no*100.0f/mpctx->sh_video->video.dwLength; | 3556 guiIntfStruct.Position=(float)mpctx->d_video->pack_no*100.0f/mpctx->sh_video->video.dwLength; |
3557 } else { | 3557 } else { |
3558 off_t len = ( mpctx->demuxer->movi_end - mpctx->demuxer->movi_start ); | 3558 guiIntfStruct.Position=demuxer_get_percent_pos(mpctx->demuxer); |
3559 off_t pos = ( mpctx->demuxer->file_format == DEMUXER_TYPE_AUDIO?mpctx->stream->pos:mpctx->demuxer->filepos ); | |
3560 guiIntfStruct.Position=(len <= 0? 0.0f : ( pos - mpctx->demuxer->movi_start ) * 100.0f / len ); | |
3561 } | 3559 } |
3562 if ( mpctx->sh_video ) guiIntfStruct.TimeSec=mpctx->sh_video->pts; | 3560 if ( mpctx->sh_video ) guiIntfStruct.TimeSec=mpctx->sh_video->pts; |
3563 else if ( mpctx->sh_audio ) guiIntfStruct.TimeSec=mpctx->delay; | 3561 else if ( mpctx->sh_audio ) guiIntfStruct.TimeSec=mpctx->delay; |
3564 guiIntfStruct.LengthInSec=demuxer_get_time_length(mpctx->demuxer); | 3562 guiIntfStruct.LengthInSec=demuxer_get_time_length(mpctx->demuxer); |
3565 guiGetEvent( guiReDraw,NULL ); | 3563 guiGetEvent( guiReDraw,NULL ); |