demux: don't adjust internal backward playback seeks by start time

Only timestamps that enter or leave the demuxer API should be adjusted
by ts_offset (which is usually the start time). queue_seek() is also
used by backward demux seeks, which uses an internal timestamp.
This commit is contained in:
wm4 2019-05-20 02:36:25 +02:00
parent 5b4ae42328
commit 5ebbde7327
1 changed files with 5 additions and 3 deletions

View File

@ -3171,7 +3171,12 @@ int demux_seek(demuxer_t *demuxer, double seek_pts, int flags)
assert(demuxer == in->d_user);
pthread_mutex_lock(&in->lock);
if (!(flags & SEEK_FACTOR))
seek_pts = MP_ADD_PTS(seek_pts, -in->ts_offset);
int res = queue_seek(in, seek_pts, flags, true);
pthread_cond_signal(&in->wakeup);
pthread_mutex_unlock(&in->lock);
@ -3187,9 +3192,6 @@ static bool queue_seek(struct demux_internal *in, double seek_pts, int flags,
MP_VERBOSE(in, "queuing seek to %f%s\n", seek_pts,
in->seeking ? " (cascade)" : "");
if (!(flags & SEEK_FACTOR))
seek_pts = MP_ADD_PTS(seek_pts, -in->ts_offset);
bool require_cache = flags & SEEK_CACHED;
flags &= ~(unsigned)SEEK_CACHED;