macosx: use the default surface on newer sdl
authorLuca Barbato <lu_zero@gentoo.org>
Mon, 17 Oct 2011 05:31:53 +0000 (22:31 -0700)
committerLuca Barbato <lu_zero@gentoo.org>
Tue, 18 Oct 2011 05:27:12 +0000 (22:27 -0700)
SDL 1.2.14 works fine with default colorspace on macosx and seems
to have some issues with 24bit surfaces and resize in addition.

avplay.c

index a4b58a5..225f81a 100644 (file)
--- a/avplay.c
+++ b/avplay.c
@@ -904,11 +904,11 @@ static int video_open(VideoState *is){
        && is->height== screen->h && screen->h == h)
         return 0;
 
-#ifndef __APPLE__
-    screen = SDL_SetVideoMode(w, h, 0, flags);
-#else
-    /* setting bits_per_pixel = 0 or 32 causes blank video on OS X */
+#if defined(__APPLE__) && !SDL_VERSION_ATLEAST(1, 2, 14)
+    /* setting bits_per_pixel = 0 or 32 causes blank video on OS X and older SDL */
     screen = SDL_SetVideoMode(w, h, 24, flags);
+#else
+    screen = SDL_SetVideoMode(w, h, 0, flags);
 #endif
     if (!screen) {
         fprintf(stderr, "SDL: could not set video mode - exiting\n");