summaryrefslogtreecommitdiffstats
path: root/player/video.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-10-28 23:57:27 +0100
committerwm4 <wm4@nowhere>2015-10-28 23:57:27 +0100
commit33489feca868dfefbfb49510f2596d91932752f0 (patch)
tree8673f7ca7ca2d973cc17933127c2527926ea2797 /player/video.c
parentce82d8821528b68fca10cfdd5271884e5afee8e4 (diff)
downloadmpv-33489feca868dfefbfb49510f2596d91932752f0.tar.bz2
mpv-33489feca868dfefbfb49510f2596d91932752f0.tar.xz
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.
Diffstat (limited to 'player/video.c')
-rw-r--r--player/video.c7
1 files changed, 2 insertions, 5 deletions
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) {