From 3054bcc62c04f8d360aba3c6f24982e78b25bcb0 Mon Sep 17 00:00:00 2001 From: sfan5 Date: Sun, 20 Sep 2020 12:04:25 +0200 Subject: options: simplify --android-surface-size handling --- video/out/android_common.c | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) (limited to 'video') diff --git a/video/out/android_common.c b/video/out/android_common.c index 52132f2d66..e32f9c1706 100644 --- a/video/out/android_common.c +++ b/video/out/android_common.c @@ -24,21 +24,6 @@ #include "options/m_config.h" #include "vo.h" -struct android_opts { - struct m_geometry surface_size; -}; - -#define OPT_BASE_STRUCT struct android_opts -const struct m_sub_options android_conf = { - .opts = (const struct m_option[]) { - {"android-surface-size", OPT_SIZE_BOX(surface_size), - .flags = UPDATE_VO_RESIZE}, - {0} - }, - .size = sizeof(struct android_opts), -}; - - struct vo_android_state { struct mp_log *log; ANativeWindow *native_window; @@ -95,16 +80,14 @@ ANativeWindow *vo_android_native_window(struct vo *vo) bool vo_android_surface_size(struct vo *vo, int *out_w, int *out_h) { struct vo_android_state *ctx = vo->android; - void *tmp = talloc_new(NULL); - struct android_opts *opts = mp_get_config_group(tmp, vo->global, &android_conf); - int w = opts->surface_size.w, h = opts->surface_size.h; + int w = vo->opts->android_surface_size.w, + h = vo->opts->android_surface_size.h; if (!w) w = ANativeWindow_getWidth(ctx->native_window); if (!h) h = ANativeWindow_getHeight(ctx->native_window); - talloc_free(tmp); if (w <= 0 || h <= 0) { MP_ERR(ctx, "Failed to get height and width.\n"); return false; -- cgit v1.2.3