[MPlayer-cvslog] r28838 - trunk/libvo/vo_gl.c

reimar subversion at mplayerhq.hu
Fri Mar 6 11:33:35 CET 2009


Author: reimar
Date: Fri Mar  6 11:33:35 2009
New Revision: 28838

Log:
DO not rely on draw_osd to render the EOSD, instead draw it already at the
end of genOSD.

Modified:
   trunk/libvo/vo_gl.c

Modified: trunk/libvo/vo_gl.c
==============================================================================
--- trunk/libvo/vo_gl.c	Fri Mar  6 10:20:14 2009	(r28837)
+++ trunk/libvo/vo_gl.c	Fri Mar  6 11:33:35 2009	(r28838)
@@ -284,6 +284,8 @@ static void clearEOSD(void) {
   eosdtex = NULL;
 }
 
+static void do_render_osd(int);
+
 /**
  * \brief construct display list from ass image list
  * \param img image list to create OSD from.
@@ -299,7 +301,7 @@ static void genEOSD(mp_eosd_images_t *im
   ass_image_t *i;
 
   if (imgs->changed == 0) // there are elements, but they are unchanged
-      return;
+      goto call_render;
   if (img && imgs->changed == 1) // there are elements, but they just moved
       goto skip_upload;
 
@@ -384,6 +386,8 @@ skip_upload:
   }
   glEndList();
   BindTexture(gl_target, 0);
+call_render:
+  if (vo_doublebuffering) do_render_osd(2);
 }
 
 /**
@@ -630,8 +634,6 @@ static void create_osd_texture(int x0, i
   osdtexCnt++;
 }
 
-static void do_render_osd(void);
-
 static void draw_osd(void)
 {
   if (!use_osd) return;
@@ -643,7 +645,7 @@ static void draw_osd(void)
     vo_draw_text_ext(osd_w, osd_h, ass_border_x, ass_border_y, ass_border_x, ass_border_y,
                      image_width, image_height, create_osd_texture);
   }
-  if (vo_doublebuffering) do_render_osd();
+  if (vo_doublebuffering) do_render_osd(1);
 }
 
 static void do_render(void) {
@@ -662,8 +664,11 @@ static void do_render(void) {
     glDisableYUVConversion(gl_target, yuvconvtype);
 }
 
-static void do_render_osd(void) {
-  if (osdtexCnt > 0 || eosdDispList) {
+/**
+ * \param type bit 0: render OSD, bit 1: render EOSD
+ */
+static void do_render_osd(int type) {
+  if (((type & 1) && osdtexCnt > 0) || ((type & 2) && eosdDispList)) {
     // set special rendering parameters
     if (!scaled_osd) {
       glMatrixMode(GL_PROJECTION);
@@ -672,11 +677,11 @@ static void do_render_osd(void) {
       glOrtho(0, vo_dwidth, vo_dheight, 0, -1, 1);
     }
     glEnable(GL_BLEND);
-    if (eosdDispList) {
+    if ((type & 2) && eosdDispList) {
       glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
       glCallList(eosdDispList);
     }
-    if (osdtexCnt > 0) {
+    if ((type & 1) && osdtexCnt > 0) {
       glColor4ub((osd_color >> 16) & 0xff, (osd_color >> 8) & 0xff, osd_color & 0xff, 0xff - (osd_color >> 24));
       // draw OSD
 #ifndef FAST_OSD
@@ -702,14 +707,14 @@ static void flip_page(void) {
       glClear(GL_COLOR_BUFFER_BIT);
   } else {
     do_render();
-    do_render_osd();
+    do_render_osd(3);
     if (use_glFinish) glFinish();
     else glFlush();
   }
 }
 
 static void redraw(void) {
-  if (vo_doublebuffering) { do_render(); do_render_osd(); }
+  if (vo_doublebuffering) { do_render(); do_render_osd(3); }
   flip_page();
 }
 



More information about the MPlayer-cvslog mailing list