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.
This commit is contained in:
wm4 2015-10-30 13:26:55 +01:00
parent 8737732035
commit acd5816a6d
2 changed files with 1 additions and 2 deletions

View File

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

View File

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