diff options
author | wm4 <wm4@nowhere> | 2017-08-14 14:02:13 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2017-08-14 14:02:13 +0200 |
commit | 68201f4591bd07c7d7027d50fdb6cc5500c7382c (patch) | |
tree | feb6fe9402487d6ce8a11656eda548e21c29b7b9 /player/loadfile.c | |
parent | b6d79deebbbb9aa95b176ad099abd5695d0a2366 (diff) | |
download | mpv-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/loadfile.c')
-rw-r--r-- | player/loadfile.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/player/loadfile.c b/player/loadfile.c index 311280d915..4a5c0e1d2c 100644 --- a/player/loadfile.c +++ b/player/loadfile.c @@ -1127,13 +1127,8 @@ done: void update_lavfi_complex(struct MPContext *mpctx) { if (mpctx->playback_initialized) { - if (reinit_complex_filters(mpctx, false) != 0 && - mpctx->canonical_pts != MP_NOPTS_VALUE) - { - // Refresh seek to avoid weird situations. - queue_seek(mpctx, MPSEEK_ABSOLUTE, mpctx->canonical_pts, - MPSEEK_EXACT, 0); - } + if (reinit_complex_filters(mpctx, false) != 0) + issue_refresh_seek(mpctx, MPSEEK_EXACT); } } @@ -1166,7 +1161,6 @@ 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; - mpctx->canonical_pts = MP_NOPTS_VALUE; mpctx->seek = (struct seek_params){ 0 }; reset_playback_state(mpctx); |