summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.xyz>2017-07-01 04:27:09 +0200
committerNiklas Haas <git@haasn.xyz>2017-07-01 04:27:09 +0200
commit69289aec6cccdf31186e51882e201c2a411d13a0 (patch)
tree63dda7e0a471711a1644c20392017a8217fad857
parent2f41c4e81b34cc8085f25a9bf016c2b98cd70cd7 (diff)
downloadmpv-69289aec6cccdf31186e51882e201c2a411d13a0.tar.bz2
mpv-69289aec6cccdf31186e51882e201c2a411d13a0.tar.xz
vo_opengl: fix some more pass_info_reset issues
2f41c4e8 exposed some other edge cases as well. Globally resetting the pass info was not the right way to go about it, because we don't know in advance what the frame type is going to be - at least not with the current code structure. (In principle, we could separately indicate the frame type and the pass type and then only reset it on the first actual pass_describe call, but that's annoying as well) Also fixes a latent issue where p->pass was never initialized, which broke the MP_DBG debugging code in some cases.
-rw-r--r--video/out/opengl/video.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/video/out/opengl/video.c b/video/out/opengl/video.c
index 6a9cbac042..224a794416 100644
--- a/video/out/opengl/video.c
+++ b/video/out/opengl/video.c
@@ -891,6 +891,9 @@ static void init_video(struct gl_video *p)
debug_check_gl(p, "after video texture creation");
gl_video_setup_hooks(p);
+
+ // make sure this variable is initialized to *something*
+ p->pass = p->pass_fresh;
}
// Release any texture mappings associated with the current frame.
@@ -2748,7 +2751,6 @@ static void gl_video_interpolate_frame(struct gl_video *p, struct vo_frame *t,
void gl_video_render_frame(struct gl_video *p, struct vo_frame *frame, int fbo)
{
GL *gl = p->gl;
- pass_info_reset(p, false);
if (fbo && !(gl->mpgl_caps & MPGL_CAP_FB)) {
MP_FATAL(p, "Rendering to FBO requested, but no FBO extension found!\n");
@@ -2825,6 +2827,7 @@ void gl_video_render_frame(struct gl_video *p, struct vo_frame *frame, int fbo)
if (is_new || !p->output_fbo_valid) {
p->output_fbo_valid = false;
+ pass_info_reset(p, false);
if (!pass_render_frame(p, frame->current, frame->frame_id))
goto done;
@@ -2875,6 +2878,12 @@ done:
gl->BindFramebuffer(GL_FRAMEBUFFER, fbo);
if (p->osd) {
+ // If we haven't actually drawn anything so far, then we technically
+ // need to consider this the start of a new pass. Let's call it a
+ // redraw just because, since it's basically a blank frame anyway
+ if (!has_frame)
+ pass_info_reset(p, true);
+
pass_draw_osd(p, p->opts.blend_subs ? OSD_DRAW_OSD_ONLY : 0,
p->osd_pts, p->osd_rect, p->vp_w, p->vp_h, fbo, true);
debug_check_gl(p, "after OSD rendering");