summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-01-23 20:37:54 +0100
committerwm4 <wm4@nowhere>2016-01-28 17:17:46 +0100
commit65b309edeead3c1681d4cdf06adb2e824c3d4a5a (patch)
tree3547abceb980e8765ca69112c3132c9a2fef221a
parent79da78621aff6013e90bf4757433bc52aee37a7d (diff)
downloadmpv-65b309edeead3c1681d4cdf06adb2e824c3d4a5a.tar.bz2
mpv-65b309edeead3c1681d4cdf06adb2e824c3d4a5a.tar.xz
video: limit additional frames to what is needed
Unlike the previous two commits, this doesn't fix bugs, and merely gets rid of unnecessary image refs/unrefs (i.e. a microoptimization).
-rw-r--r--player/video.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/player/video.c b/player/video.c
index bee6cd5cb0..5c5e7fb39c 100644
--- a/player/video.c
+++ b/player/video.c
@@ -1293,11 +1293,12 @@ void write_video(struct MPContext *mpctx, double endpts)
};
calculate_frame_duration(mpctx);
+ int max_queue = vo_get_num_req_frames(mpctx->video_out);
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, max_queue),
.num_vsyncs = 1,
};
for (int n = 0; n < dummy.num_frames; n++)