summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-09-08 15:54:08 +0200
committerwm4 <wm4@nowhere>2016-09-08 16:06:12 +0200
commit8bb9632e273e78963af85ab4c4cd275e69d77713 (patch)
tree2ad42a01044cdf0d89ba561698ace78fda76f6a1
parent2048ad2b8af1becddb70cad2a7adc0361b779443 (diff)
downloadmpv-8bb9632e273e78963af85ab4c4cd275e69d77713.tar.bz2
mpv-8bb9632e273e78963af85ab4c4cd275e69d77713.tar.xz
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.
-rw-r--r--video/out/opengl/video.c3
1 files changed, 1 insertions, 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))