diff options
Diffstat (limited to 'libmpdemux/demux_mf.c')
-rw-r--r-- | libmpdemux/demux_mf.c | 6 |
1 files 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; } |