From 8bb9632e273e78963af85ab4c4cd275e69d77713 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 8 Sep 2016 15:54:08 +0200 Subject: [PATCH] vo_opengl: simplify a condition The " || vimg->mpi" part virtually never seems to trigger, but on the other hand could possibly create unintended corner cases (for example by trying to upload a NULL image, which would then be marked as an error and render a blue screen). I guess it's a leftover from over times, where a NULL image meant "redraw the current frame". This is now handled by actually passing along the current frame. --- video/out/opengl/video.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/video/out/opengl/video.c b/video/out/opengl/video.c index 0e1f58e7e8..fa9ef41ef0 100644 --- a/video/out/opengl/video.c +++ b/video/out/opengl/video.c @@ -2668,7 +2668,6 @@ static void timer_dbg(struct gl_video *p, const char *name, struct gl_timer *t) void gl_video_render_frame(struct gl_video *p, struct vo_frame *frame, int fbo) { GL *gl = p->gl; - struct video_image *vimg = &p->image; if (fbo && !(gl->mpgl_caps & MPGL_CAP_FB)) { MP_FATAL(p, "Rendering to FBO requested, but no FBO extension found!\n"); @@ -2679,7 +2678,7 @@ void gl_video_render_frame(struct gl_video *p, struct vo_frame *frame, int fbo) gl->BindFramebuffer(GL_FRAMEBUFFER, fbo); - bool has_frame = frame->current || vimg->mpi; + bool has_frame = !!frame->current; if (!has_frame || p->dst_rect.x0 > 0 || p->dst_rect.y0 > 0 || p->dst_rect.x1 < p->vp_w || p->dst_rect.y1 < abs(p->vp_h))