From a96c3ac90e73c51ace0ee7a65439c71327057df1 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 23 Jan 2015 12:00:16 +0100 Subject: vo: allow dropping additional frames with smoothmotion The logic disabled framedropping if the frame was interpolated (i.e. the render call is only done to interpolate between the previous frame, and the frame before that). It seems doing this wasn't even necessary, and broke framedrop in smoothmotion mode. In fact, this code did nothing for display with video fps below display fps. It did prevent the framedrop counter from going up, though. So change it so that dropped interpolated frames are never reported. (Doing so can give confusing results, such as dropping 1000s of frames on slow operations like video start or changing filters.) --- video/out/vo.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/video/out/vo.c b/video/out/vo.c index cbab1ac5b1..afc963e8fd 100644 --- a/video/out/vo.c +++ b/video/out/vo.c @@ -579,17 +579,17 @@ static bool render_frame(struct vo *vo) in->dropped_frame &= mp_time_us() - in->last_flip < 100 * 1000; if (in->vsync_timed) { - in->dropped_frame &= !!img; - // this is a heuristic that wakes the thread up some // time before the next vsync target = next_vsync - MPMIN(in->vsync_interval / 3, 4e3); - // we are very late with the frame and using vsync timing: probably + // We are very late with the frame and using vsync timing: probably // no new frames are coming in. This must be done whether or not - // framedrop is enabled. - if (!img && in->hasframe_rendered && - prev_vsync > pts + in->vsync_interval_approx) + // framedrop is enabled. Also, if the frame is to be dropped, even + // though it's an interpolated frame (img==NULL), exit early. + if (!img && ((in->hasframe_rendered && + prev_vsync > pts + in->vsync_interval_approx) + || in->dropped_frame)) { in->dropped_frame = false; in->rendering = false; -- cgit v1.2.3