summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2012-09-23 20:28:05 +0200
committerwm4 <wm4@nowhere>2012-10-03 03:17:39 +0200
commitd079395c5d33749422e730697092f7d8e2bb3263 (patch)
treed061231d264d99fe1a8f487ccac05a6401742659
parent3611d1bf9ba6f34909108166aaa21deaffc72c57 (diff)
downloadmpv-d079395c5d33749422e730697092f7d8e2bb3263.tar.bz2
mpv-d079395c5d33749422e730697092f7d8e2bb3263.tar.xz
vo_opengl: always check GL errors in first 5 frames
Normally, we don't want to call glGetError() all the time, because this supposedly causes slowdowns. (I could not measure any on Linux with nVidia binary drivers; maybe it's due to the fact that we have only a few, expensive calls per frame.) However, having to ask users to add the "debug" suboption when trying to diagnose problems is very annoying. Since most errors happen during initialization only, enabling it for the first 5 frames only is an interesting compromise.
-rw-r--r--libvo/vo_opengl.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libvo/vo_opengl.c b/libvo/vo_opengl.c
index 2f1cc0545b..92cc489e47 100644
--- a/libvo/vo_opengl.c
+++ b/libvo/vo_opengl.c
@@ -234,6 +234,8 @@ struct gl_priv {
struct vo_rect dst_rect; // video rectangle on output window
int border_x, border_y; // OSD borders
int vp_x, vp_y, vp_w, vp_h; // GL viewport
+
+ int frames_rendered;
};
struct fmt_entry {
@@ -275,7 +277,7 @@ static void default_tex_params(struct GL *gl, GLenum target, GLint filter)
static void debug_check_gl(struct gl_priv *p, const char *msg)
{
- if (p->use_gl_debug)
+ if (p->use_gl_debug || p->frames_rendered < 5)
glCheckError(p->gl, msg);
}
@@ -1238,6 +1240,8 @@ static void flip_page(struct vo *vo)
{
gl->Clear(GL_COLOR_BUFFER_BIT);
}
+
+ p->frames_rendered++;
}
static int draw_slice(struct vo *vo, uint8_t *src[], int stride[], int w, int h,