From ab19b3c9d31c5bcff41bab9bf9c39c022e8edf9e Mon Sep 17 00:00:00 2001 From: jrodatus Date: Sat, 17 Jun 2017 10:18:57 -0400 Subject: 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 --- player/playloop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'player') 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(); } -- cgit v1.2.3