[MPlayer-cvslog] r34900 - in trunk/libvo: sdl_common.c sdl_common.h vo_gl.c

reimar subversion at mplayerhq.hu
Mon May 14 22:24:43 CEST 2012


Author: reimar
Date: Mon May 14 22:24:43 2012
New Revision: 34900

Log:
Fix -fs with SDL-based vo gl.

Modified:
   trunk/libvo/sdl_common.c
   trunk/libvo/sdl_common.h
   trunk/libvo/vo_gl.c

Modified: trunk/libvo/sdl_common.c
==============================================================================
--- trunk/libvo/sdl_common.c	Mon May 14 21:52:52 2012	(r34899)
+++ trunk/libvo/sdl_common.c	Mon May 14 22:24:43 2012	(r34900)
@@ -93,6 +93,19 @@ void vo_sdl_uninit(void)
         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) {

Modified: trunk/libvo/sdl_common.h
==============================================================================
--- trunk/libvo/sdl_common.h	Mon May 14 21:52:52 2012	(r34899)
+++ trunk/libvo/sdl_common.h	Mon May 14 22:24:43 2012	(r34900)
@@ -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);

Modified: trunk/libvo/vo_gl.c
==============================================================================
--- trunk/libvo/vo_gl.c	Mon May 14 21:52:52 2012	(r34899)
+++ trunk/libvo/vo_gl.c	Mon May 14 22:24:43 2012	(r34900)
@@ -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 @@ static int create_window(uint32_t d_widt
 #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;


More information about the MPlayer-cvslog mailing list