diff options
Diffstat (limited to 'video/out/vo_sdl.c')
-rw-r--r-- | video/out/vo_sdl.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/video/out/vo_sdl.c b/video/out/vo_sdl.c index e59ef0472b..fa9b593b55 100644 --- a/video/out/vo_sdl.c +++ b/video/out/vo_sdl.c @@ -197,6 +197,7 @@ struct priv { // options int allow_sw; int switch_mode; + int vsync; }; static bool is_good_renderer(SDL_RendererInfo *ri, @@ -771,12 +772,8 @@ static int preinit(struct vo *vo, const char *arg) SDL_HINT_DEFAULT); // predefine MPV options (SDL env vars shall be overridden) - if (vo->opts->vsync) - SDL_SetHintWithPriority(SDL_HINT_RENDER_VSYNC, "1", - SDL_HINT_OVERRIDE); - else - SDL_SetHintWithPriority(SDL_HINT_RENDER_VSYNC, "0", - SDL_HINT_OVERRIDE); + SDL_SetHintWithPriority(SDL_HINT_RENDER_VSYNC, vc->vsync ? "1" : "0", + SDL_HINT_OVERRIDE); if (SDL_InitSubSystem(SDL_INIT_VIDEO)) { mp_msg(MSGT_VO, MSGL_ERR, "[sdl] SDL_Init failed\n"); @@ -1025,11 +1022,13 @@ const struct vo_driver video_out_sdl = { }, .priv_size = sizeof(struct priv), .priv_defaults = &(const struct priv) { - .renderer_index = -1 + .renderer_index = -1, + .vsync = 1, }, .options = (const struct m_option []){ OPT_FLAG("sw", allow_sw, 0), OPT_FLAG("switch-mode", switch_mode, 0), + OPT_FLAG("vsync", vsync, 0), {NULL} }, .preinit = preinit, |