mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
Fix segfault on Mac OS X, patch by Earl Levine elevine**@**gmail**.**com.
Originally committed as revision 5408 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
b4aead58cb
commit
4b0e85d4ab
9
ffplay.c
9
ffplay.c
@ -2434,8 +2434,8 @@ int main(int argc, char **argv)
|
|||||||
video_disable = 1;
|
video_disable = 1;
|
||||||
}
|
}
|
||||||
flags = SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_TIMER;
|
flags = SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_TIMER;
|
||||||
#ifndef CONFIG_WIN32
|
#if !defined(CONFIG_WIN32) && !defined(CONFIG_DARWIN)
|
||||||
flags |= SDL_INIT_EVENTTHREAD; /* Not supported on win32 */
|
flags |= SDL_INIT_EVENTTHREAD; /* Not supported on win32 or darwin */
|
||||||
#endif
|
#endif
|
||||||
if (SDL_Init (flags)) {
|
if (SDL_Init (flags)) {
|
||||||
fprintf(stderr, "Could not initialize SDL - %s\n", SDL_GetError());
|
fprintf(stderr, "Could not initialize SDL - %s\n", SDL_GetError());
|
||||||
@ -2466,7 +2466,12 @@ int main(int argc, char **argv)
|
|||||||
h = screen_height;
|
h = screen_height;
|
||||||
flags |= SDL_RESIZABLE;
|
flags |= SDL_RESIZABLE;
|
||||||
}
|
}
|
||||||
|
#ifndef CONFIG_DARWIN
|
||||||
screen = SDL_SetVideoMode(w, h, 0, flags);
|
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) {
|
if (!screen) {
|
||||||
fprintf(stderr, "SDL: could not set video mode - exiting\n");
|
fprintf(stderr, "SDL: could not set video mode - exiting\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
|
Loading…
Reference in New Issue
Block a user