changeset 34812:f2274219a79c

Fix -fs with SDL-based vo gl.
author reimar
date Mon, 14 May 2012 20:24:43 +0000
parents 57eee2db5fe7
children 183979fd93d9
files libvo/sdl_common.c libvo/sdl_common.h libvo/vo_gl.c
diffstat 3 files changed, 17 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/sdl_common.c	Mon May 14 19:52:52 2012 +0000
+++ b/libvo/sdl_common.c	Mon May 14 20:24:43 2012 +0000
@@ -93,6 +93,19 @@
         SDL_QuitSubSystem(SDL_INIT_VIDEO);
 }
 
+int vo_sdl_config(int w, int h, int flags, const char *title)
+{
+    SDL_WM_SetCaption(title, NULL);
+    vo_dwidth  = old_w = w;
+    vo_dheight = old_h = h;
+    vo_fs = !!(flags & VOFLAG_FULLSCREEN);
+    if (vo_fs) {
+        vo_dwidth  = vo_screenwidth;
+        vo_dheight = vo_screenheight;
+    }
+    return 1;
+}
+
 void vo_sdl_fullscreen(void)
 {
     if (vo_fs) {
--- a/libvo/sdl_common.h	Mon May 14 19:52:52 2012 +0000
+++ b/libvo/sdl_common.h	Mon May 14 20:24:43 2012 +0000
@@ -31,6 +31,7 @@
 
 int vo_sdl_init(void);
 void vo_sdl_uninit(void);
+int vo_sdl_config(int w, int h, int flags, const char *title);
 void vo_sdl_fullscreen(void);
 SDL_Surface *sdl_set_mode(int bpp, uint32_t flags);
 int sdl_default_handle_event(SDL_Event *event);
--- a/libvo/vo_gl.c	Mon May 14 19:52:52 2012 +0000
+++ b/libvo/vo_gl.c	Mon May 14 20:24:43 2012 +0000
@@ -42,11 +42,7 @@
 #include "sub/eosd.h"
 
 #ifdef CONFIG_GL_SDL
-#ifdef CONFIG_SDL_SDL_H
-#include <SDL/SDL.h>
-#else
-#include <SDL.h>
-#endif
+#include "sdl_common.h"
 #endif
 
 static const vo_info_t info =
@@ -659,9 +655,8 @@
 #endif
 #ifdef CONFIG_GL_SDL
   if (glctx.type == GLTYPE_SDL) {
-    SDL_WM_SetCaption(title, NULL);
-    vo_dwidth  = d_width;
-    vo_dheight = d_height;
+    if (!vo_sdl_config(d_width, d_height, flags, title))
+        return -1;
   }
 #endif
   return 0;