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).
This commit is contained in:
wm4 2016-08-20 18:12:12 +02:00
parent af103aebd7
commit 6b676d82fd
1 changed files with 5 additions and 8 deletions

View File

@ -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