1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-30 19:22:11 +00:00

video: limit number of frames sent to VO to the VO requested amount

vo_frame can have more than 1 frame - the extra frames are future
references, which are sometimes useful for filtering (vo_opengl
interpolation). There's no harm in reducing the number of frames sent to
the VO requested amount of future frames, so do that.

Doesn't actually reduce the number of concurrently in use frames in
practice.
This commit is contained in:
wm4 2016-07-07 16:10:13 +02:00
parent ab6fac43b4
commit 8660b4c9f0

View File

@ -1419,11 +1419,13 @@ void write_video(struct MPContext *mpctx)
};
calculate_frame_duration(mpctx);
int req = vo_get_num_req_frames(mpctx->video_out);
assert(req >= 1 && req <= VO_MAX_REQ_FRAMES);
struct vo_frame dummy = {
.pts = pts,
.duration = -1,
.still = mpctx->step_frames > 0,
.num_frames = MPMIN(mpctx->num_next_frames, VO_MAX_REQ_FRAMES),
.num_frames = MPMIN(mpctx->num_next_frames, req),
.num_vsyncs = 1,
};
for (int n = 0; n < dummy.num_frames; n++)