summaryrefslogtreecommitdiffstats
path: root/player/playloop.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-08-14 14:02:13 +0200
committerwm4 <wm4@nowhere>2017-08-14 14:02:13 +0200
commit68201f4591bd07c7d7027d50fdb6cc5500c7382c (patch)
treefeb6fe9402487d6ce8a11656eda548e21c29b7b9 /player/playloop.c
parentb6d79deebbbb9aa95b176ad099abd5695d0a2366 (diff)
downloadmpv-68201f4591bd07c7d7027d50fdb6cc5500c7382c.tar.bz2
mpv-68201f4591bd07c7d7027d50fdb6cc5500c7382c.tar.xz
player: make refresh seeks slightly more robust
Refresh seeks are automatically issued when changing filters, which improves user experience if these filters change buffering or such. The refresh seek could actually overwrite a previously ongoing seek: set pause yes set time-pos 10 set vf "" Here, the video code issued a refresh seek to the previous video position, which could be different from the previously triggered (and still ongoing) seek, this overwriting the seek. Factor all refresh seek handling into a new function, and make it handle ongoing seeks correctly. Remove the weird new canonical_pts field, which actually had no use. Fixes #4757.
Diffstat (limited to 'player/playloop.c')
-rw-r--r--player/playloop.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/player/playloop.c b/player/playloop.c
index 0d3409065b..ea73981a4f 100644
--- a/player/playloop.c
+++ b/player/playloop.c
@@ -232,6 +232,7 @@ void reset_playback_state(struct MPContext *mpctx)
mpctx->hrseek_framedrop = false;
mpctx->hrseek_lastframe = false;
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->cache_wait_time = 0;
@@ -377,7 +378,7 @@ static void mp_seek(MPContext *mpctx, struct seek_params seek)
mpctx->ab_loop_clip = mpctx->last_seek_pts < opts->ab_loop[1];
- mpctx->canonical_pts = mpctx->last_seek_pts;
+ mpctx->current_seek = seek;
}
// This combines consecutive seek requests.
@@ -958,8 +959,6 @@ static void handle_playback_time(struct MPContext *mpctx)
{
mpctx->playback_pts = playing_audio_pts(mpctx);
}
- if (mpctx->playback_pts != MP_NOPTS_VALUE)
- mpctx->canonical_pts = mpctx->playback_pts;
}
// We always make sure audio and video buffers are filled before actually
@@ -993,6 +992,7 @@ static void handle_playback_restart(struct MPContext *mpctx)
if (!mpctx->restart_complete) {
mpctx->hrseek_active = false;
mpctx->restart_complete = true;
+ mpctx->current_seek = (struct seek_params){0};
mpctx->audio_allow_second_chance_seek = false;
handle_playback_time(mpctx);
mp_notify(mpctx, MPV_EVENT_PLAYBACK_RESTART, NULL);