diff options
author | wm4 <wm4@nowhere> | 2019-05-20 02:36:25 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2019-09-19 20:37:04 +0200 |
commit | 5ebbde7327f3a6f7946fd7d59116b93c933d3f83 (patch) | |
tree | 620a4f08558aba22666d0d0b180efe84974f3661 | |
parent | 5b4ae42328b75b2f7683d04736d3c07108b0bcc3 (diff) | |
download | mpv-5ebbde7327f3a6f7946fd7d59116b93c933d3f83.tar.bz2 mpv-5ebbde7327f3a6f7946fd7d59116b93c933d3f83.tar.xz |
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.
-rw-r--r-- | demux/demux.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/demux/demux.c b/demux/demux.c index 92121c9b7b..019a8469c7 100644 --- a/demux/demux.c +++ b/demux/demux.c @@ -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; |