summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-10-30 13:26:55 +0100
committerwm4 <wm4@nowhere>2015-10-30 13:26:55 +0100
commitacd5816a6df9e2de9e8dd307dde12a90717d464a (patch)
treec535f508e39cc8dd109eface1a7bcb0aa7f5b5f9 /video
parent8737732035264b0b5ca3c7db05ec0ed73a1fa155 (diff)
downloadmpv-acd5816a6df9e2de9e8dd307dde12a90717d464a.tar.bz2
mpv-acd5816a6df9e2de9e8dd307dde12a90717d464a.tar.xz
video: fix framedrop accounting in display-sync mode
Commit a1315c76 broke this slightly. Frame drops got counted multiple times, and also vo.c was actually trying to "render" the dropped frame over and over again (normally not a problem, since frames are always queued "tightly" in display-sync mode, but could have caused 100% CPU usage in some rare corner cases). Do not repeat already dropped frames, but still treat new frames with num_vsyncs==0 as dropped frames. Also, strictly count dropped frames in the VO. This means we don't count "soft" dropped frames anymore (frames that are shown, but for fewer vsyncs than intended). This will be adjusted in the next commit.
Diffstat (limited to 'video')
-rw-r--r--video/out/vo.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/video/out/vo.c b/video/out/vo.c
index 2926167b1e..5bc34c0f1b 100644
--- a/video/out/vo.c
+++ b/video/out/vo.c
@@ -618,6 +618,7 @@ static bool render_frame(struct vo *vo)
in->current_frame = in->frame_queued;
in->frame_queued = NULL;
} else if (in->paused || !in->current_frame || !in->hasframe ||
+ in->current_frame->num_vsyncs < 1 ||
(!in->vsync_timed && !in->current_frame->display_synced))
{
goto done;