changeset 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 499738cca90b
children 09f97d0161ba
files mplayer.c
diffstat 1 files changed, 1 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mplayer.c	Sun Mar 25 22:36:26 2007 +0000
+++ b/mplayer.c	Mon Mar 26 09:26:02 2007 +0000
@@ -3555,9 +3555,7 @@
 	  // get pos from frame number / total frames
 	  guiIntfStruct.Position=(float)mpctx->d_video->pack_no*100.0f/mpctx->sh_video->video.dwLength;
 	} else {
-	 off_t len = ( mpctx->demuxer->movi_end - mpctx->demuxer->movi_start );
-	 off_t pos = ( mpctx->demuxer->file_format == DEMUXER_TYPE_AUDIO?mpctx->stream->pos:mpctx->demuxer->filepos );
-	 guiIntfStruct.Position=(len <= 0? 0.0f : ( pos - mpctx->demuxer->movi_start ) * 100.0f / len );
+          guiIntfStruct.Position=demuxer_get_percent_pos(mpctx->demuxer);
 	}
 	if ( mpctx->sh_video ) guiIntfStruct.TimeSec=mpctx->sh_video->pts;
 	  else if ( mpctx->sh_audio ) guiIntfStruct.TimeSec=mpctx->delay;