From 4a1657da01da373332f484d26441835975bb4e4b Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 20 Jul 2015 21:12:46 +0200 Subject: vo: minor simplification for queue size handling Instead of calling it "future frames" and adding or subtracting 1 from it, always call it "requested frames". This simplifies it a bit. MPContext.next_frames had 2 added to it; this was mainly to ensure a minimum size of 2. Drop it and assume VO_MAX_REQ_FRAMES is at least 2; together with the other changes, this can be the exact size of the array. --- player/video.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'player/video.c') diff --git a/player/video.c b/player/video.c index 6de89fc31e..57ec9d64d1 100644 --- a/player/video.c +++ b/player/video.c @@ -604,10 +604,10 @@ static int get_req_frames(struct MPContext *mpctx, bool eof) if (eof || mpctx->video_pts == MP_NOPTS_VALUE) return 1; - int req = 1 + vo_get_num_future_frames(mpctx->video_out); + int req = vo_get_num_req_frames(mpctx->video_out); if (opts->frame_dropping & 1) req = MPMAX(req, 2); - return req; + return MPMIN(req, MP_ARRAY_SIZE(mpctx->next_frames)); } // Whether it's fine to call add_new_frame() now. -- cgit v1.2.3