From 46cb1b7c455bf298f96971ff2460233d71609829 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 22 May 2014 09:28:39 +0200 Subject: vo: minor simplifications --- video/out/vo.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'video') diff --git a/video/out/vo.c b/video/out/vo.c index a73ce61ff7..c02b9d9c24 100644 --- a/video/out/vo.c +++ b/video/out/vo.c @@ -300,9 +300,7 @@ void vo_queue_image(struct vo *vo, struct mp_image *mpi) // Return whether vo_queue_image() should be called. bool vo_needs_new_image(struct vo *vo) { - if (!vo->config_ok) - return false; - return vo->num_video_queue < vo->max_video_queue; + return vo->config_ok && vo->num_video_queue < vo->max_video_queue; } // Return whether a frame can be displayed. @@ -310,8 +308,6 @@ bool vo_needs_new_image(struct vo *vo) // eof==false: return true if "enough" frames are queued bool vo_has_next_frame(struct vo *vo, bool eof) { - if (!vo->config_ok) - return false; // Normally, buffer 1 image ahead, except if the queue is limited to less // than 2 entries, or if EOF is reached and there aren't enough images left. return eof ? vo->num_video_queue : vo->num_video_queue == vo->max_video_queue; @@ -327,9 +323,7 @@ double vo_get_next_pts(struct vo *vo, int index) int vo_redraw_frame(struct vo *vo) { - if (!vo->config_ok) - return -1; - if (vo_control(vo, VOCTRL_REDRAW_FRAME, NULL) == true) { + if (vo->config_ok && vo_control(vo, VOCTRL_REDRAW_FRAME, NULL) == true) { vo->want_redraw = false; return 0; } @@ -338,9 +332,7 @@ int vo_redraw_frame(struct vo *vo) bool vo_get_want_redraw(struct vo *vo) { - if (!vo->config_ok) - return false; - return vo->want_redraw; + return vo->config_ok && vo->want_redraw; } // Remove vo->video_queue[0] -- cgit v1.2.3