summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2018-05-17 13:13:00 +0200
committerwm4 <wm4@nowhere>2018-05-24 19:56:34 +0200
commit4d2b3fca3b5c6e61d2ff3a22f78b1b640500808e (patch)
treee7427fbb456f6e0eece7223ed30600e6e9865227
parent972989db7e63c199edb605884bb2594eaecc9569 (diff)
downloadmpv-4d2b3fca3b5c6e61d2ff3a22f78b1b640500808e.tar.bz2
mpv-4d2b3fca3b5c6e61d2ff3a22f78b1b640500808e.tar.xz
player: don't reset last_seek_pts on playback state reset
This is nonsense. Didn't matter in most situations, because seeking itself set this after it was cleared. But some callers don't do this, see e.g. commit ed73ba89644fc6. There is no need to clear it at all, and it causes issues with the next commit. It only needs to be reset on loading. Also move the initialization on loading up, which doesn't change behavior, but makes the intention clearer.
-rw-r--r--player/loadfile.c5
-rw-r--r--player/playloop.c1
2 files changed, 2 insertions, 4 deletions
diff --git a/player/loadfile.c b/player/loadfile.c
index c4e013793d..a16df30eed 100644
--- a/player/loadfile.c
+++ b/player/loadfile.c
@@ -1285,15 +1285,14 @@ static void play_current_file(struct MPContext *mpctx)
mpctx->speed_factor_a = mpctx->speed_factor_v = 1.0;
mpctx->display_sync_error = 0.0;
mpctx->display_sync_active = false;
+ // let get_current_time() show 0 as start time (before playback_pts is set)
+ mpctx->last_seek_pts = 0.0;
mpctx->seek = (struct seek_params){ 0 };
mpctx->filter_root = mp_filter_create_root(mpctx->global);
mp_filter_root_set_wakeup_cb(mpctx->filter_root, mp_wakeup_core_cb, mpctx);
reset_playback_state(mpctx);
- // let get_current_time() show 0 as start time (before playback_pts is set)
- mpctx->last_seek_pts = 0.0;
-
mpctx->playing = mpctx->playlist->current;
if (!mpctx->playing || !mpctx->playing->filename)
goto terminate_playback;
diff --git a/player/playloop.c b/player/playloop.c
index a784bfd554..f51ddb5e5c 100644
--- a/player/playloop.c
+++ b/player/playloop.c
@@ -228,7 +228,6 @@ void reset_playback_state(struct MPContext *mpctx)
mpctx->hrseek_backstep = false;
mpctx->current_seek = (struct seek_params){0};
mpctx->playback_pts = MP_NOPTS_VALUE;
- mpctx->last_seek_pts = MP_NOPTS_VALUE;
mpctx->step_frames = 0;
mpctx->ab_loop_clip = true;
mpctx->restart_complete = false;