diff options
author | sfan5 <sfan5@live.de> | 2020-09-20 12:04:25 +0200 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2020-09-20 12:04:25 +0200 |
commit | 3054bcc62c04f8d360aba3c6f24982e78b25bcb0 (patch) | |
tree | c54188323ff6f18c5e6a2c132d99044c6982783a /video | |
parent | 7831e52238790bf1742b194e0469cf3db5f59bdd (diff) | |
download | mpv-3054bcc62c04f8d360aba3c6f24982e78b25bcb0.tar.bz2 mpv-3054bcc62c04f8d360aba3c6f24982e78b25bcb0.tar.xz |
options: simplify --android-surface-size handling
Diffstat (limited to 'video')
-rw-r--r-- | video/out/android_common.c | 21 |
1 files changed, 2 insertions, 19 deletions
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; |