From 76590563aa8b305ce539273f99a7e93c3a0dc561 Mon Sep 17 00:00:00 2001 From: gpoirier Date: Wed, 26 Jul 2006 09:30:43 +0000 Subject: [PATCH] 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 --- libmpdemux/demux_mf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libmpdemux/demux_mf.c b/libmpdemux/demux_mf.c index a676d3ba34..ec5a7630d9 100644 --- a/libmpdemux/demux_mf.c +++ b/libmpdemux/demux_mf.c @@ -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; }