changeset 35616:92ec362e0737

Fix missing screen clear with -nodouble.
author reimar
date Mon, 24 Dec 2012 20:15:26 +0000
parents 26a91d76cfda
children af2bae18c49f
files libvo/vo_gl.c
diffstat 1 files changed, 9 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- 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;
 }