From 6b676d82fd698b3b76c14986f5212698af57c3ca Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 20 Aug 2016 18:12:12 +0200 Subject: vo: be more trusting to estimated display FPS This should actually be rather safe - we already check whether the estimated value jitters less than the (possibly untrustworthy) nominal one. Remove a "safety" check that disabled this code for small deviations, and make it trigger sooner into playback. Also lower the log level of messages about using the estimated display FPS down to verbose. Normally there's another mechanism for smoothing out minor estimation differences, but that is not good enough here. This possibly improves behavior as reported in #3433, which can be reproduced with --vo=null:fps=48.426 --display-fps=48 (though it doesn't consider the jitter introduced by a real VO). --- video/out/vo.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/video/out/vo.c b/video/out/vo.c index f31f55f378..139b840c23 100644 --- a/video/out/vo.c +++ b/video/out/vo.c @@ -344,9 +344,7 @@ static void check_estimated_display_fps(struct vo *vo) struct vo_internal *in = vo->in; bool use_estimated = false; - if (in->num_total_vsync_samples >= MAX_VSYNC_SAMPLES * 2 && - fabs((in->nominal_vsync_interval - in->estimated_vsync_interval)) - >= 0.01 * in->nominal_vsync_interval && + if (in->num_total_vsync_samples >= MAX_VSYNC_SAMPLES / 2 && in->estimated_vsync_interval <= 1e6 / 20.0 && in->estimated_vsync_interval >= 1e6 / 99.0) { @@ -363,12 +361,11 @@ static void check_estimated_display_fps(struct vo *vo) } if (use_estimated == (in->vsync_interval == in->nominal_vsync_interval)) { if (use_estimated) { - MP_WARN(vo, "Reported display FPS seems incorrect.\n" - "Assuming a value closer to %.3f Hz.\n", - 1e6 / in->estimated_vsync_interval); + MP_VERBOSE(vo, "adjusting display FPS to a value closer to %.3f Hz\n", + 1e6 / in->estimated_vsync_interval); } else { - MP_WARN(vo, "Switching back to assuming %.3f Hz.\n", - 1e6 / in->nominal_vsync_interval); + MP_VERBOSE(vo, "switching back to assuming display fps = %.3f Hz\n", + 1e6 / in->nominal_vsync_interval); } } in->vsync_interval = use_estimated ? (int64_t)in->estimated_vsync_interval -- cgit v1.2.3