diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2009-03-06 10:33:35 +0000 |
---|---|---|
committer | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2009-03-06 10:33:35 +0000 |
commit | 397c4db88b78e67ad738eeb06ab8848fe79349dd (patch) | |
tree | c0ebe1f57169ea61f414013b918c2675d2b22d99 | |
parent | 27b512e1f58b273e3f36113f72a121da66cf9a5b (diff) |
Do not rely on draw_osd to render the EOSD, instead draw it already at the
end of genOSD.
Fixes that the EOSD was drawn one frame too late.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28838 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r-- | libvo/vo_gl.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/libvo/vo_gl.c b/libvo/vo_gl.c index 0ffcab00a4..19ae7e9c75 100644 --- a/libvo/vo_gl.c +++ b/libvo/vo_gl.c @@ -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 *imgs) { 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, int y0, int w, int h, 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(); } |