video: reset `display_sync_error` when resetting state

This would cause mpv to, in some very specific scenarios, have a
negative vsync_offset after seeking which would result in mpv requesting
a pts before the first frame to libplacebo.

Fix it by setting it to 0 when we reset state, such as after seeking.

Fixes: https://github.com/mpv-player/mpv/issues/12813
This commit is contained in:
llyyr 2023-11-06 00:07:16 +05:30 committed by sfan5
parent a7186777de
commit 0257d53d2c
1 changed files with 1 additions and 0 deletions

View File

@ -119,6 +119,7 @@ void reset_video_state(struct MPContext *mpctx)
mpctx->mistimed_frames_total = 0;
mpctx->drop_message_shown = 0;
mpctx->display_sync_drift_dir = 0;
mpctx->display_sync_error = 0;
mpctx->video_status = mpctx->vo_chain ? STATUS_SYNCING : STATUS_EOF;
}