1
0
mirror of https://github.com/mpv-player/mpv synced 2025-03-11 08:37:59 +00:00

player: be slightly less prone to framedrop in display sync mode

1 to 2 frames desync is still tolerable, and will be quickly compensated
(if everything works).
This commit is contained in:
wm4 2015-10-19 23:45:43 +02:00
parent b0b67cdf5d
commit 750c29766f

View File

@ -960,10 +960,14 @@ static void handle_display_sync_frame(struct MPContext *mpctx,
// If we are too far ahead/behind, attempt to drop/repeat frames. In
// particular, don't attempt to change speed for them.
if (drop) {
if (drop)
drop_repeat = -av_diff / vsync; // round towards 0
// Tolerate at least 1 video frame desync.
if (abs(drop_repeat) <= 1)
drop_repeat = 0;
av_diff += drop_repeat * vsync;
}
if (resample) {
double audio_factor = 1.0;