summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2017-11-14 12:31:41 +0100
committerJan Ekström <jeebjp@gmail.com>2017-11-14 20:46:18 +0200
commit3471e27efb8cd200857bbbe5e91ca623c518088f (patch)
treee2afd6d8e83c39d0e460ae5707905b87faa3643d /video
parentff1ee66231084771e8ade0dbc1c04fd918ad9466 (diff)
downloadmpv-3471e27efb8cd200857bbbe5e91ca623c518088f.tar.bz2
mpv-3471e27efb8cd200857bbbe5e91ca623c518088f.tar.xz
vo_gpu/context_android: Process surface resizes correctly
Diffstat (limited to 'video')
-rw-r--r--video/out/opengl/context_android.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/video/out/opengl/context_android.c b/video/out/opengl/context_android.c
index f98ec1ea03..a2acce2223 100644
--- a/video/out/opengl/context_android.c
+++ b/video/out/opengl/context_android.c
@@ -33,7 +33,6 @@ struct priv {
EGLContext egl_context;
EGLSurface egl_surface;
ANativeWindow *native_window;
- int w, h;
};
static void android_swap_buffers(struct ra_ctx *ctx)
@@ -106,12 +105,6 @@ static bool android_init(struct ra_ctx *ctx)
goto fail;
}
- if (!eglQuerySurface(p->egl_display, p->egl_surface, EGL_WIDTH, &p->w) ||
- !eglQuerySurface(p->egl_display, p->egl_surface, EGL_HEIGHT, &p->h)) {
- MP_FATAL(ctx, "Failed to get height and width!\n");
- goto fail;
- }
-
mpegl_load_functions(&p->gl, ctx->log);
struct ra_gl_ctx_params params = {
@@ -130,9 +123,17 @@ fail:
static bool android_reconfig(struct ra_ctx *ctx)
{
struct priv *p = ctx->priv;
- ctx->vo->dwidth = p->w;
- ctx->vo->dheight = p->h;
- ra_gl_ctx_resize(ctx->swapchain, p->w, p->h, 0);
+ int w, h;
+
+ if (!eglQuerySurface(p->egl_display, p->egl_surface, EGL_WIDTH, &w) ||
+ !eglQuerySurface(p->egl_display, p->egl_surface, EGL_HEIGHT, &h)) {
+ MP_FATAL(ctx, "Failed to get height and width!\n");
+ return false;
+ }
+
+ ctx->vo->dwidth = w;
+ ctx->vo->dheight = h;
+ ra_gl_ctx_resize(ctx->swapchain, w, h, 0);
return true;
}