summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-01-26 12:29:27 +0100
committerDiogo Franco (Kovensky) <diogomfranco@gmail.com>2015-01-27 10:20:19 +0900
commitc61f76829f26eee43f5f82a29c13b729d10a5232 (patch)
tree718bf205d294a3899242ec8a53eb0d14f8f5e134
parent30e77e0fc50aaffb5ca41914e1782bfe88ef425b (diff)
downloadmpv-c61f76829f26eee43f5f82a29c13b729d10a5232.tar.bz2
mpv-c61f76829f26eee43f5f82a29c13b729d10a5232.tar.xz
player: fix framestep over timeline segment boundaries
This was subtly broken by commit a937ba20. Instead of framestepping over the timeline segment boundary, it would just unpause playback, because seeking now resets mpctx->step_frames. This was especially apparent when doing something like "mpv *.jpg --merge-files". Fix by restoring the step_frames field specifically if the seek is done for switching segment boundaries. Hopefully the number fields which need such an exception on seeking won't grow and turn this code into a mess.
-rw-r--r--player/playloop.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/player/playloop.c b/player/playloop.c
index 55ff59fa10..cba23b79d7 100644
--- a/player/playloop.c
+++ b/player/playloop.c
@@ -168,6 +168,7 @@ static int mp_seek(MPContext *mpctx, struct seek_params seek,
{
struct MPOpts *opts = mpctx->opts;
uint64_t prev_seek_ts = mpctx->vo_pts_history_seek_ts;
+ int prev_step = mpctx->step_frames;
if (!mpctx->demuxer)
return -1;
@@ -263,6 +264,7 @@ static int mp_seek(MPContext *mpctx, struct seek_params seek,
if (timeline_fallthrough) {
// Important if video reinit happens.
mpctx->vo_pts_history_seek_ts = prev_seek_ts;
+ mpctx->step_frames = prev_step;
} else {
mpctx->vo_pts_history_seek_ts++;
mpctx->backstep_active = false;