summaryrefslogtreecommitdiffstats
path: root/video/out/vo.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-07-20 21:12:46 +0200
committerwm4 <wm4@nowhere>2015-07-20 21:12:46 +0200
commit4a1657da01da373332f484d26441835975bb4e4b (patch)
tree10ae7106b128286a6f37572670f23b1561ece759 /video/out/vo.c
parent6f7d04be21de7bdfce3c7c38a4d5fae17451b409 (diff)
downloadmpv-4a1657da01da373332f484d26441835975bb4e4b.tar.bz2
mpv-4a1657da01da373332f484d26441835975bb4e4b.tar.xz
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.
Diffstat (limited to 'video/out/vo.c')
-rw-r--r--video/out/vo.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/video/out/vo.c b/video/out/vo.c
index 1db8fa3490..e538860452 100644
--- a/video/out/vo.c
+++ b/video/out/vo.c
@@ -959,25 +959,24 @@ const char *vo_get_window_title(struct vo *vo)
// flip_page[_timed] will be called offset_us microseconds too early.
// (For vo_vdpau, which does its own timing.)
// Setting vsync_timed to true redraws as fast as possible.
-// num_future_frames set the requested number of future frames in
-// struct frame_timing.
-// (For vo_opengl smoothmotion.)
+// num_req_frames set the requested number of requested vo_frame.frames.
+// (For vo_opengl interpolation.)
void vo_set_queue_params(struct vo *vo, int64_t offset_us, bool vsync_timed,
- int num_future_frames)
+ int num_req_frames)
{
struct vo_internal *in = vo->in;
pthread_mutex_lock(&in->lock);
in->flip_queue_offset = offset_us;
in->vsync_timed = vsync_timed;
- in->req_frames = 1 + MPMIN(num_future_frames, VO_MAX_FUTURE_FRAMES);
+ in->req_frames = MPCLAMP(num_req_frames, 1, VO_MAX_REQ_FRAMES);
pthread_mutex_unlock(&in->lock);
}
-int vo_get_num_future_frames(struct vo *vo)
+int vo_get_num_req_frames(struct vo *vo)
{
struct vo_internal *in = vo->in;
pthread_mutex_lock(&in->lock);
- int res = in->req_frames - 1;
+ int res = in->req_frames;
pthread_mutex_unlock(&in->lock);
return res;
}