From 33489feca868dfefbfb49510f2596d91932752f0 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 28 Oct 2015 23:57:27 +0100 Subject: player: raise display sync desync tolerance Bump it to 80, and 2 vsyncs. This is another measure against vsync jitter. Admittedly this is a bit simplistic (and we should probably estimate a stable estimated vsync phase instead), but for now this will do. --- player/video.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'player/video.c') diff --git a/player/video.c b/player/video.c index c9213deb2c..1fb54fe75d 100644 --- a/player/video.c +++ b/player/video.c @@ -962,13 +962,10 @@ 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) + // Tolerate some desync to avoid frame dropping due to jitter. + if (drop && fabs(av_diff) >= 0.080 && fabs(av_diff) / vsync >= 2) 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) { -- cgit v1.2.3