From 1198c031e4233a0cff5aa7d24aab986163f6903a Mon Sep 17 00:00:00 2001 From: Alexander Preisinger Date: Mon, 4 Mar 2013 22:41:27 +0100 Subject: vo: Separate vo options from MPOpts Separate the video output options from the big MPOpts structure and also only pass the new mp_vo_opts structure to the vo backend. Move video_driver_list into mp_vo_opts --- video/out/vo_sdl.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'video/out/vo_sdl.c') diff --git a/video/out/vo_sdl.c b/video/out/vo_sdl.c index b10a237b19..e59ef0472b 100644 --- a/video/out/vo_sdl.c +++ b/video/out/vo_sdl.c @@ -271,7 +271,7 @@ static bool try_create_renderer(struct vo *vo, int i, const char *driver, if (!is_good_renderer(&ri, driver, vc->allow_sw, NULL)) return false; - bool xy_valid = vo->opts->vo.geometry.xy_valid; + bool xy_valid = vo->opts->geometry.xy_valid; // then actually try vc->window = SDL_CreateWindow("MPV", @@ -387,7 +387,7 @@ static void set_fullscreen(struct vo *vo, int fs) // toggling fullscreen might recreate the window, so better guard for this SDL_DisableScreenSaver(); - vo->opts->vo.fs = fs; + vo->opts->fs = fs; force_resize(vo); } @@ -470,21 +470,21 @@ static void flip_page(struct vo *vo) static void check_events(struct vo *vo) { struct priv *vc = vo->priv; - struct MPOpts *opts = vo->opts; + struct mp_vo_opts *opts = vo->opts; SDL_Event ev; - if (opts->vo.cursor_autohide_delay >= 0) { + if (opts->cursor_autohide_delay >= 0) { if (!vc->mouse_hidden && - (GetTimerMS() - vc->mouse_timer >= opts->vo.cursor_autohide_delay)) { + (GetTimerMS() - vc->mouse_timer >= opts->cursor_autohide_delay)) { SDL_ShowCursor(0); vc->mouse_hidden = 1; } - } else if (opts->vo.cursor_autohide_delay == -1) { + } else if (opts->cursor_autohide_delay == -1) { if (vc->mouse_hidden) { SDL_ShowCursor(1); vc->mouse_hidden = 0; } - } else if (opts->vo.cursor_autohide_delay == -2) { + } else if (opts->cursor_autohide_delay == -2) { if (!vc->mouse_hidden) { SDL_ShowCursor(0); vc->mouse_hidden = 1; @@ -553,7 +553,7 @@ static void check_events(struct vo *vo) break; } case SDL_MOUSEMOTION: - if (opts->vo.cursor_autohide_delay >= 0) { + if (opts->cursor_autohide_delay >= 0) { SDL_ShowCursor(1); vc->mouse_hidden = 0; vc->mouse_timer = GetTimerMS(); @@ -561,7 +561,7 @@ static void check_events(struct vo *vo) vo_mouse_movement(vo, ev.motion.x, ev.motion.y); break; case SDL_MOUSEBUTTONDOWN: - if (opts->vo.cursor_autohide_delay >= 0) { + if (opts->cursor_autohide_delay >= 0) { SDL_ShowCursor(1); vc->mouse_hidden = 0; vc->mouse_timer = GetTimerMS(); @@ -570,7 +570,7 @@ static void check_events(struct vo *vo) (MP_MOUSE_BTN0 + ev.button.button - 1) | MP_KEY_STATE_DOWN); break; case SDL_MOUSEBUTTONUP: - if (opts->vo.cursor_autohide_delay >= 0) { + if (opts->cursor_autohide_delay >= 0) { SDL_ShowCursor(1); vc->mouse_hidden = 0; vc->mouse_timer = GetTimerMS(); @@ -771,7 +771,7 @@ static int preinit(struct vo *vo, const char *arg) SDL_HINT_DEFAULT); // predefine MPV options (SDL env vars shall be overridden) - if (vo->opts->vo.vsync) + if (vo->opts->vsync) SDL_SetHintWithPriority(SDL_HINT_RENDER_VSYNC, "1", SDL_HINT_OVERRIDE); else @@ -921,10 +921,10 @@ static void update_screeninfo(struct vo *vo) mp_msg(MSGT_VO, MSGL_ERR, "[sdl] SDL_GetCurrentDisplayMode failed\n"); return; } - struct MPOpts *opts = vo->opts; - opts->vo.screenwidth = mode.w; - opts->vo.screenheight = mode.h; - aspect_save_screenres(vo, opts->vo.screenwidth, opts->vo.screenheight); + struct mp_vo_opts *opts = vo->opts; + opts->screenwidth = mode.w; + opts->screenheight = mode.h; + aspect_save_screenres(vo, opts->screenwidth, opts->screenheight); } static struct mp_image *get_screenshot(struct vo *vo) @@ -981,7 +981,7 @@ static int control(struct vo *vo, uint32_t request, void *data) { switch (request) { case VOCTRL_FULLSCREEN: - set_fullscreen(vo, !vo->opts->vo.fs); + set_fullscreen(vo, !vo->opts->fs); return 1; case VOCTRL_REDRAW_FRAME: draw_image(vo, NULL); -- cgit v1.2.3