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.
This commit is contained in:
Uoti Urpala 2009-04-24 02:18:19 +03:00
parent 7180728cba
commit 1b272e3b2d
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}