[FFmpeg-devel] [PATCH 1/2] ffplay: fixes crash on osx with libsdl < 1.2.14

Jean First jeanfirst at gmail.com
Wed Oct 19 14:13:55 CEST 2011


As proposed by Luca.
---
 ffplay.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/ffplay.c b/ffplay.c
index b41820c..ffd6ae5 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -943,7 +943,12 @@ static int video_open(VideoState *is){
     if(screen && is->width == screen->w && screen->w == w
        && is->height== screen->h && screen->h == h)
         return 0;
+#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");
         do_exit(is);
-- 
1.7.6.1



More information about the ffmpeg-devel mailing list