summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2009-04-24 02:18:19 +0300
committerUoti Urpala <uau@glyph.nonexistent.invalid>2009-04-24 02:18:19 +0300
commit1b272e3b2d8de97744c5316e5bdbeb6e8b867b1d (patch)
treed0c6ba8f7251fcd0adeb8f2a1e70e8ec76622932
parent7180728cbad8196146010e12191e0b5f1ce560b1 (diff)
downloadmpv-1b272e3b2d8de97744c5316e5bdbeb6e8b867b1d.tar.bz2
mpv-1b272e3b2d8de97744c5316e5bdbeb6e8b867b1d.tar.xz
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.
-rw-r--r--libmpdemux/demux_lavf.c2
1 files changed, 1 insertions, 1 deletions
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;
}