summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Preisinger <alexander.preisinger@gmail.com>2013-03-13 20:01:12 +0100
committerAlexander Preisinger <alexander.preisinger@gmail.com>2013-03-13 20:01:12 +0100
commitf7ad81737bd87d47218e6294f03ede2c4108d3a3 (patch)
tree970315519b885fc9d4da4e5cc9120fe19862b6a1
parentdb6325853ad8c57143f00452157c18ddd96a65a6 (diff)
downloadmpv-f7ad81737bd87d47218e6294f03ede2c4108d3a3.tar.bz2
mpv-f7ad81737bd87d47218e6294f03ede2c4108d3a3.tar.xz
wayland: remove asserts from egl_create_context
Instead of assert return false on most check. Removes the redundant second inclusion of the assert header.
-rw-r--r--video/out/gl_common.c24
1 files changed, 7 insertions, 17 deletions
diff --git a/video/out/gl_common.c b/video/out/gl_common.c
index c2e3fed7e6..43e8c0de78 100644
--- a/video/out/gl_common.c
+++ b/video/out/gl_common.c
@@ -1312,7 +1312,6 @@ static void swapGlBuffers_x11(MPGLContext *ctx)
#include <wayland-egl.h>
#include <EGL/egl.h>
#include <EGL/eglext.h>
-#include <assert.h>
struct egl_context {
EGLSurface egl_surface;
@@ -1377,13 +1376,11 @@ static bool egl_create_context(struct vo_wayland_state *wl,
MPGLContext *ctx)
{
EGLint major, minor, n;
- EGLBoolean ret;
GL *gl = ctx->gl;
const char *eglstr = "";
- egl_ctx->egl.dpy = eglGetDisplay(wl->display->display);
- if (!egl_ctx->egl.dpy)
+ if (!(egl_ctx->egl.dpy = eglGetDisplay(wl->display->display)))
return false;
EGLint config_attribs[] = {
@@ -1398,8 +1395,7 @@ static bool egl_create_context(struct vo_wayland_state *wl,
};
/* major and minor here returns the supported EGL version (e.g.: 1.4) */
- ret = eglInitialize(egl_ctx->egl.dpy, &major, &minor);
- if (ret != EGL_TRUE)
+ if (eglInitialize(egl_ctx->egl.dpy, &major, &minor) != EGL_TRUE)
return false;
EGLint context_attribs[] = {
@@ -1412,12 +1408,11 @@ static bool egl_create_context(struct vo_wayland_state *wl,
EGL_NONE
};
- ret = eglBindAPI(EGL_OPENGL_API);
- assert(ret == EGL_TRUE);
+ if (eglBindAPI(EGL_OPENGL_API) != EGL_TRUE)
+ return false;
- ret = eglChooseConfig(egl_ctx->egl.dpy, config_attribs,
- &egl_ctx->egl.conf, 1, &n);
- assert(ret && n == 1);
+ eglChooseConfig(egl_ctx->egl.dpy, config_attribs,
+ &egl_ctx->egl.conf, 1, &n);
egl_ctx->egl.ctx = eglCreateContext(egl_ctx->egl.dpy,
egl_ctx->egl.conf,
@@ -1426,12 +1421,7 @@ static bool egl_create_context(struct vo_wayland_state *wl,
if (!egl_ctx->egl.ctx)
return false;
- ret = eglMakeCurrent(egl_ctx->egl.dpy,
- NULL,
- NULL,
- egl_ctx->egl.ctx);
-
- assert(ret == EGL_TRUE);
+ eglMakeCurrent(egl_ctx->egl.dpy, NULL, NULL, egl_ctx->egl.ctx);
eglstr = eglQueryString(egl_ctx->egl.dpy, EGL_EXTENSIONS);