From 99c0130bdacbb774bc02f220d48c91f651a5338c Mon Sep 17 00:00:00 2001 From: reimar Date: Sun, 29 Oct 2006 12:32:12 +0000 Subject: [PATCH] Quick hack to implement percent-based seeking, also fixes seeking with gmplayer git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20508 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpdemux/demux_real.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libmpdemux/demux_real.c b/libmpdemux/demux_real.c index 07747b6dbd..e97eae4d67 100644 --- a/libmpdemux/demux_real.c +++ b/libmpdemux/demux_real.c @@ -1841,6 +1841,8 @@ static void demux_seek_real(demuxer_t *demuxer, float rel_seek_secs, float audio if (flags & 1) /* seek absolute */ priv->current_apacket = priv->current_vpacket = 0; + if (flags & 2) // percent seek + rel_seek_secs *= priv->duration; if ((streams & 1) && priv->current_vpacket >= priv->index_table_size[vid]) priv->current_vpacket = priv->index_table_size[vid] - 1;