diff libvo/sdl_common.c @ 34611:f1a31e5fc35f

vo_sdl: reuse some more sdl_common code.
author reimar
date Sun, 12 Feb 2012 18:49:07 +0000
parents e227a8ae4418
children f9f91ba805b9
line wrap: on
line diff
--- a/libvo/sdl_common.c	Sun Feb 12 18:44:19 2012 +0000
+++ b/libvo/sdl_common.c	Sun Feb 12 18:49:07 2012 +0000
@@ -109,24 +109,26 @@
     reinit = 1;
 }
 
-int sdl_set_mode(int bpp, uint32_t flags)
+SDL_Surface *sdl_set_mode(int bpp, uint32_t flags)
 {
     SDL_Surface *s;
     mode_flags = flags;
     if (vo_fs) flags |= SDL_FULLSCREEN;
     // doublebuf with opengl creates flickering
+#if !defined( __AMIGAOS4__ ) && !defined( __APPLE__ )
     if (vo_doublebuffering && !(flags & SDL_OPENGL))
         flags |= SDL_DOUBLEBUF;
+#endif
     if (!vo_border)
         flags |= SDL_NOFRAME;
     s = SDL_SetVideoMode(vo_dwidth, vo_dheight, bpp, flags);
     if (!s) {
       mp_msg(MSGT_VO, MSGL_FATAL, "SDL SetVideoMode failed: %s\n", SDL_GetError());
-      return -1;
+      return NULL;
     }
     vo_dwidth  = s->w;
     vo_dheight = s->h;
-    return 0;
+    return s;
 }
 
 static const struct mp_keymap keysym_map[] = {