[Ffmpeg-devel] Ffplay segfault on Mac OS X

Earl Levine elevine
Wed May 17 13:11:43 CEST 2006


I had the same crash as described here when trying to run ffplay on OS X:
http://mplayerhq.hu/pipermail/ffmpeg-devel/2006-May/010905.html

I was able to get ffplay to work on OS X with the patch below.

earl

___________________________________________________________________

diff -Naur ffmpeg-orig/ffplay.c ffmpeg/ffplay.c
--- ffmpeg-orig/ffplay.c        2006-01-12 14:43:14.000000000 -0800
+++ ffmpeg/ffplay.c     2006-05-17 03:59:04.000000000 -0700
@@ -2434,8 +2434,8 @@
         video_disable = 1;
     }
     flags = SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_TIMER;
-#ifndef CONFIG_WIN32
-    flags |= SDL_INIT_EVENTTHREAD; /* Not supported on win32 */
+#if !defined(CONFIG_WIN32) && !defined(CONFIG_DARWIN)
+    flags |= SDL_INIT_EVENTTHREAD; /* Not supported on win32 or darwin */
 #endif
     if (SDL_Init (flags)) {
         fprintf(stderr, "Could not initialize SDL - %s\n", SDL_GetError());
@@ -2466,7 +2466,12 @@
             h = screen_height;
             flags |= SDL_RESIZABLE;
         }
+#ifndef CONFIG_DARWIN
         screen = SDL_SetVideoMode(w, h, 0, flags);
+#else
+        /* setting bits_per_pixel = 0 or 32 causes blank video on OS X */
+        screen = SDL_SetVideoMode(w, h, 24, flags);
+#endif
         if (!screen) {
             fprintf(stderr, "SDL: could not set video mode - exiting\n");
             exit(1);




More information about the ffmpeg-devel mailing list