fix 3 bugs in libmpdemux/demux_mf.c

1. Relative seek is seeking 1 frame too far.
2. Percent seek is seeking 1 frame too far (beyond EOF) at 100%.
3. Check for EOF is checking 1 frame too far.
Patch by Paul-Francois Fontigny < pff AAA filmik PPP be>
Original thread:
Date: Jul 16, 2006 12:40 PM
Subject: [MPlayer-dev-eng] [PATCH] bugfix for libmpdemux/demux_mf.c


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19185 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
gpoirier 2006-07-26 09:30:43 +00:00
parent aa0c9bcec1
commit 76590563aa
1 changed files with 3 additions and 3 deletions

View File

@ -18,12 +18,12 @@
static void demux_seek_mf(demuxer_t *demuxer,float rel_seek_secs,float audio_delay,int flags){
mf_t * mf = (mf_t *)demuxer->priv;
sh_video_t * sh_video = demuxer->video->sh;
int newpos = (flags & 1)?0:mf->curr_frame;
int newpos = (flags & 1)?0:mf->curr_frame - 1;
if ( flags & 2 ) newpos+=rel_seek_secs*mf->nr_of_files;
if ( flags & 2 ) newpos+=rel_seek_secs*(mf->nr_of_files - 1);
else newpos+=rel_seek_secs * sh_video->fps;
if ( newpos < 0 ) newpos=0;
if( newpos > mf->nr_of_files) newpos=mf->nr_of_files;
if( newpos >= mf->nr_of_files) newpos=mf->nr_of_files - 1;
mf->curr_frame=newpos;
}