summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-08-20 18:12:12 +0200
committerwm4 <wm4@nowhere>2016-08-20 18:15:17 +0200
commit6b676d82fd698b3b76c14986f5212698af57c3ca (patch)
tree31c627f40268d19472d5cb5bb1672432c65c35a9
parentaf103aebd73609fa143b07805082a23525c8a306 (diff)
downloadmpv-6b676d82fd698b3b76c14986f5212698af57c3ca.tar.bz2
mpv-6b676d82fd698b3b76c14986f5212698af57c3ca.tar.xz
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).
-rw-r--r--video/out/vo.c13
1 files 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