From 1b272e3b2d8de97744c5316e5bdbeb6e8b867b1d Mon Sep 17 00:00:00 2001 From: Uoti Urpala Date: Fri, 24 Apr 2009 02:18:19 +0300 Subject: demux_lavf: Make absolute seek time 0-based instead of file start demux_lavf interpreted absolute seeks as relative to the start of the file, so if the file didn't start at timestamp 0 then seeking to timestamp X went to a position MPlayer would display as start+X. Make the seeks use the same timestamps as used in the original file. This works better for most use cases as no part of MPlayer normally uses or displays such "since start of file" timestamp values. There could be some cases where the old semantics are useful, but I think they do not justify making it the default behavior; a separate feature for that could be added if it turns out to be needed. --- libmpdemux/demux_lavf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libmpdemux/demux_lavf.c b/libmpdemux/demux_lavf.c index cea44dc50f..21f3d21155 100644 --- a/libmpdemux/demux_lavf.c +++ b/libmpdemux/demux_lavf.c @@ -611,7 +611,7 @@ static void demux_seek_lavf(demuxer_t *demuxer, float rel_seek_secs, float audio mp_msg(MSGT_DEMUX,MSGL_DBG2,"demux_seek_lavf(%p, %f, %f, %d)\n", demuxer, rel_seek_secs, audio_delay, flags); if (flags & SEEK_ABSOLUTE) { - priv->last_pts = priv->avfc->start_time; + priv->last_pts = 0; } else { if (rel_seek_secs < 0) avsflags = AVSEEK_FLAG_BACKWARD; } -- cgit v1.2.3