diff options
author | wm4 <wm4@nowhere> | 2013-01-23 10:56:11 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-01-23 10:56:11 +0100 |
commit | 4c56baba4048f8a881253d4fe2f49c2715c77376 (patch) | |
tree | d75891df8cd30c404072f9b67b6da21188b79ba8 /video/out/vo_sdl.c | |
parent | f2dcdca0c2dc5f904323659b65b29a2b6f00fd88 (diff) | |
download | mpv-4c56baba4048f8a881253d4fe2f49c2715c77376.tar.bz2 mpv-4c56baba4048f8a881253d4fe2f49c2715c77376.tar.xz |
options: move -geometry parsing to m_option.c
This also means the option is verified on program start, not when the VO
is created. The actual code becomes a bit more complex, because the
screen width/height is not available at program start.
The actual parsing code is still the same, with its unusual sscanf()
usage.
Diffstat (limited to 'video/out/vo_sdl.c')
-rw-r--r-- | video/out/vo_sdl.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/video/out/vo_sdl.c b/video/out/vo_sdl.c index 99af9355ed..ec4cc97ca0 100644 --- a/video/out/vo_sdl.c +++ b/video/out/vo_sdl.c @@ -46,7 +46,6 @@ #include "aspect.h" #include "config.h" #include "vo.h" -#include "geometry.h" struct formatmap_entry { Uint32 sdl; @@ -272,14 +271,12 @@ 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; + // then actually try vc->window = SDL_CreateWindow("MPV", - geometry_xy_changed - ? vo->dx - : SDL_WINDOWPOS_UNDEFINED, - geometry_xy_changed - ? vo->dy - : SDL_WINDOWPOS_UNDEFINED, + xy_valid ? vo->dx : SDL_WINDOWPOS_UNDEFINED, + xy_valid ? vo->dy : SDL_WINDOWPOS_UNDEFINED, w, h, SDL_WINDOW_RESIZABLE | SDL_WINDOW_HIDDEN); if (!vc->window) { |