summaryrefslogtreecommitdiffstats
path: root/player/playloop.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2019-05-24 02:30:44 +0200
committerwm4 <wm4@nowhere>2019-09-19 20:37:04 +0200
commita8b9ba10ac8ad3cf45aeec88f4509e7b4450af60 (patch)
treee575ed1ef05cbe2503c4142f07e9d93e7ded5a30 /player/playloop.c
parentadf4d52ee8b3abf1509f8ccc12fb78ed1560b63d (diff)
downloadmpv-a8b9ba10ac8ad3cf45aeec88f4509e7b4450af60.tar.bz2
mpv-a8b9ba10ac8ad3cf45aeec88f4509e7b4450af60.tar.xz
demux: set SEEK_HR for backstep seeks, move a hr-seek detail to playloop
Just rearranging shit. Setting SEEK_HR for backstep seeks actually doesn't have much meaning, but disables the weird audio snapping for "keyframe" seeks, and I don't know it's late.
Diffstat (limited to 'player/playloop.c')
-rw-r--r--player/playloop.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/player/playloop.c b/player/playloop.c
index 85890c2ef1..8bf5325986 100644
--- a/player/playloop.c
+++ b/player/playloop.c
@@ -305,6 +305,10 @@ static void mp_seek(MPContext *mpctx, struct seek_params seek)
demux_flags |= SEEK_FACTOR;
}
+ int play_dir = opts->play_dir;
+ if (play_dir < 0)
+ demux_flags |= SEEK_SATAN;
+
if (hr_seek) {
double hr_seek_offset = opts->hr_seek_demuxer_offset;
// Always try to compensate for possibly bad demuxers in "special"
@@ -321,15 +325,15 @@ static void mp_seek(MPContext *mpctx, struct seek_params seek)
}
demux_pts -= hr_seek_offset;
demux_flags = (demux_flags | SEEK_HR) & ~SEEK_FORWARD;
+ // For HR seeks in backward playback mode, the correct seek rounding
+ // direction is forward instead of backward.
+ if (play_dir < 0)
+ demux_flags |= SEEK_FORWARD;
}
if (!mpctx->demuxer->seekable)
demux_flags |= SEEK_CACHED;
- int play_dir = opts->play_dir;
- if (play_dir < 0)
- demux_flags |= SEEK_SATAN;
-
if (!demux_seek(mpctx->demuxer, demux_pts, demux_flags)) {
if (!mpctx->demuxer->seekable) {
MP_ERR(mpctx, "Cannot seek in this stream.\n");