diff options
author | wm4 <wm4@nowhere> | 2016-09-30 12:20:35 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-09-30 13:06:31 +0200 |
commit | 2f1af04745191250cb833704ffa55a47e1ee563b (patch) | |
tree | 48d47adb2d1660f331d481f1bbb7fc71af2655d0 | |
parent | d3111ee7775c8c7f56f2c68907a7fe2c6ee138be (diff) | |
download | mpv-2f1af04745191250cb833704ffa55a47e1ee563b.tar.bz2 mpv-2f1af04745191250cb833704ffa55a47e1ee563b.tar.xz |
vo_opengl: egl: print EGL errors only if not probing
Avoids printing an error when trying to create a GLES 3.x context on a
device which can do GLES 2.0 only.
-rw-r--r-- | video/out/opengl/egl_helpers.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/video/out/opengl/egl_helpers.c b/video/out/opengl/egl_helpers.c index 598e3512ae..31a31dfb24 100644 --- a/video/out/opengl/egl_helpers.c +++ b/video/out/opengl/egl_helpers.c @@ -31,10 +31,11 @@ #define EGL_OPENGL_ES3_BIT 0x00000040 #endif -static bool create_context(EGLDisplay display, struct mp_log *log, int msgl, +static bool create_context(EGLDisplay display, struct mp_log *log, bool probing, int vo_flags, bool es3, EGLContext *out_context, EGLConfig *out_config) { + int msgl = probing ? MSGL_V : MSGL_FATAL; bool es = vo_flags & VOFLAG_GLES; @@ -143,23 +144,25 @@ bool mpegl_create_context(EGLDisplay display, struct mp_log *log, int vo_flags, STR_OR_ERR(version), STR_OR_ERR(vendor), STR_OR_ERR(apis)); int clean_flags = vo_flags & ~(unsigned)(VOFLAG_GLES | VOFLAG_NO_GLES); - int msgl = vo_flags & VOFLAG_PROBING ? MSGL_V : MSGL_FATAL; + bool probing = vo_flags & VOFLAG_PROBING; + int msgl = probing ? MSGL_V : MSGL_FATAL; + bool try_desktop = !(vo_flags & VOFLAG_NO_GLES); if (!(vo_flags & VOFLAG_GLES)) { // Desktop OpenGL - if (create_context(display, log, msgl, clean_flags, false, + if (create_context(display, log, try_desktop | probing, clean_flags, false, out_context, out_config)) return true; } - if (!(vo_flags & VOFLAG_NO_GLES)) { + if (try_desktop) { // ES 3.x - if (create_context(display, log, msgl, clean_flags | VOFLAG_GLES, true, + if (create_context(display, log, true, clean_flags | VOFLAG_GLES, true, out_context, out_config)) return true; // ES 2.0 - if (create_context(display, log, msgl, clean_flags | VOFLAG_GLES, false, + if (create_context(display, log, probing, clean_flags | VOFLAG_GLES, false, out_context, out_config)) return true; } |