summaryrefslogtreecommitdiffstats
path: root/player/video.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-07-07 16:10:13 +0200
committerwm4 <wm4@nowhere>2016-07-07 16:10:13 +0200
commit8660b4c9f08d2cfab9e3a72330d68597777827bb (patch)
treedb322b75c1c5ea4416a5977087449a07b40394a1 /player/video.c
parentab6fac43b4bc34949bd9c4da8e911fc9f3489a32 (diff)
downloadmpv-8660b4c9f08d2cfab9e3a72330d68597777827bb.tar.bz2
mpv-8660b4c9f08d2cfab9e3a72330d68597777827bb.tar.xz
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.
Diffstat (limited to 'player/video.c')
-rw-r--r--player/video.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/player/video.c b/player/video.c
index d413ffe4fb..9819fe4705 100644
--- a/player/video.c
+++ b/player/video.c
@@ -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++)