# HG changeset patch # User reimar # Date 1356380126 0 # Node ID 92ec362e0737fce1490571a93b7bbfedf46d5193 # Parent 26a91d76cfdaa81a40f7572817e2eb935c40f6eb Fix missing screen clear with -nodouble. diff -r 26a91d76cfda -r 92ec362e0737 libvo/vo_gl.c --- a/libvo/vo_gl.c Mon Dec 24 14:22:46 2012 +0000 +++ b/libvo/vo_gl.c Mon Dec 24 20:15:26 2012 +0000 @@ -907,6 +907,7 @@ } static void flip_page(void) { + int need_clear = aspect_scaling() && use_aspect; // We might get an expose event between draw_image and its // corresponding flip_page. // For double-buffering we would then flip in a clear backbuffer. @@ -914,18 +915,20 @@ // current GL buffer contains a properly rendered video. // did_render will always be false for single buffer. if (!did_render) { + if (!vo_doublebuffering && need_clear) + mpglClear(GL_COLOR_BUFFER_BIT); do_render(); do_render_osd(RENDER_OSD | RENDER_EOSD); } + if (use_glFinish) mpglFinish(); + if (vo_doublebuffering) { - if (use_glFinish) mpglFinish(); glctx.swapGlBuffers(&glctx); - if (aspect_scaling() && use_aspect) + if (need_clear) mpglClear(GL_COLOR_BUFFER_BIT); - } else { - if (use_glFinish) mpglFinish(); - else mpglFlush(); - } + } else if (!use_glFinish) + mpglFlush(); + did_render = 0; }