summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjrodatus <jrodatus@gmail.com>2017-06-17 10:18:57 -0400
committerwm4 <wm4@nowhere>2017-06-18 20:54:45 +0200
commitab19b3c9d31c5bcff41bab9bf9c39c022e8edf9e (patch)
treeddb0384ee8dd0f0b4aecfb2c783823f026994f2c
parent2ba2062e5b0b53d2b14fc81c377d0b0b3d6f4a99 (diff)
downloadmpv-ab19b3c9d31c5bcff41bab9bf9c39c022e8edf9e.tar.bz2
mpv-ab19b3c9d31c5bcff41bab9bf9c39c022e8edf9e.tar.xz
player: seek backward for type MPSEEK_FACTOR
Choosing the seek direction for MPSEEK_FACTOR based on the location of seek_pts is nonsense, and can cause the seek position to oscillate between adjacent keyframes, such as when dragging the OSC bar on short videos. Fix this by always seeking backward for type MPSEEK_FACTOR, i.e. seek to the keyframe for the group of pictures (GOP) in which seek_pts is located. Fixes #4183. Signed-off-by: wm4 <wm4@nowhere>
-rw-r--r--player/playloop.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/player/playloop.c b/player/playloop.c
index 2e18025cc4..09387ed66f 100644
--- a/player/playloop.c
+++ b/player/playloop.c
@@ -284,7 +284,7 @@ static void mp_seek(MPContext *mpctx, struct seek_params seek)
double len = get_time_length(mpctx);
if (len >= 0)
seek_pts = seek.amount * len;
- demux_flags = seek_pts > current_time ? SEEK_FORWARD : SEEK_BACKWARD;
+ demux_flags = SEEK_BACKWARD;
break;
default: abort();
}