summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-05-22 09:28:39 +0200
committerwm4 <wm4@nowhere>2014-05-22 09:28:39 +0200
commit46cb1b7c455bf298f96971ff2460233d71609829 (patch)
tree6538f5759ff816b0ccb692df89d00539cde25b09 /video
parent09386b173e438204591251424b896b73998a16b0 (diff)
downloadmpv-46cb1b7c455bf298f96971ff2460233d71609829.tar.bz2
mpv-46cb1b7c455bf298f96971ff2460233d71609829.tar.xz
vo: minor simplifications
Diffstat (limited to 'video')
-rw-r--r--video/out/vo.c14
1 files changed, 3 insertions, 11 deletions
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]