summaryrefslogtreecommitdiffstats
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
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.
-rw-r--r--player/video.c2
-rw-r--r--video/out/vo.c1
2 files changed, 1 insertions, 2 deletions
diff --git a/player/video.c b/player/video.c
index 1fb54fe75d..af98c676ed 100644
--- a/player/video.c
+++ b/player/video.c
@@ -1022,8 +1022,6 @@ static void handle_display_sync_frame(struct MPContext *mpctx,
// corner cases or exceptional situations cause too much havoc.
drop_repeat = MPCLAMP(drop_repeat, -num_vsyncs, num_vsyncs * 10);
num_vsyncs += drop_repeat;
- if (drop_repeat < 0)
- vo_increment_drop_count(vo, 1);
// Estimate the video position, so we can calculate a good A/V difference
// value below. This is used to estimate A/V drift.
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;