From 3ef17d626fc06d0ba38d8b3a60dc3334d07705a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5ns=20Rullg=C3=A5rd?= Date: Fri, 9 Jun 2006 22:43:21 +0000 Subject: [PATCH] don't use xlib in ffplay, and bump required sdl version Originally committed as revision 5463 to svn://svn.ffmpeg.org/ffmpeg/trunk --- configure | 2 +- ffplay.c | 56 +++++++++++++++---------------------------------------- 2 files changed, 16 insertions(+), 42 deletions(-) diff --git a/configure b/configure index ba20a7da33..b4f6ac2773 100755 --- a/configure +++ b/configure @@ -1184,7 +1184,7 @@ EOF restore_flags if test $? = 0; then _sdlversion=`"${SDL_CONFIG}" --version | sed 's/[^0-9]//g'` - if test "$_sdlversion" -lt 121 ; then + if test "$_sdlversion" -lt 130 ; then sdl_too_old=yes else sdl=yes diff --git a/ffplay.c b/ffplay.c index 360ee9716a..030a760ae4 100644 --- a/ffplay.c +++ b/ffplay.c @@ -45,14 +45,6 @@ } #endif -#if defined(__linux__) -#define HAVE_X11 -#endif - -#ifdef HAVE_X11 -#include -#endif - //#define DEBUG_SYNC #define MAX_VIDEOQ_SIZE (5 * 256 * 1024) @@ -2104,25 +2096,19 @@ void toggle_full_screen(void) { int w, h, flags; is_full_screen = !is_full_screen; - if (!fs_screen_width) { - /* use default SDL method */ - SDL_WM_ToggleFullScreen(screen); + flags = SDL_HWSURFACE|SDL_ASYNCBLIT|SDL_HWACCEL; + if (is_full_screen) { + w = fs_screen_width; + h = fs_screen_height; + flags |= SDL_FULLSCREEN; } else { - /* use the recorded resolution */ - flags = SDL_HWSURFACE|SDL_ASYNCBLIT|SDL_HWACCEL; - if (is_full_screen) { - w = fs_screen_width; - h = fs_screen_height; - flags |= SDL_FULLSCREEN; - } else { - w = screen_width; - h = screen_height; - flags |= SDL_RESIZABLE; - } - screen = SDL_SetVideoMode(w, h, 0, flags); - cur_stream->width = w; - cur_stream->height = h; + w = screen_width; + h = screen_height; + flags |= SDL_RESIZABLE; } + screen = SDL_SetVideoMode(w, h, 0, flags); + cur_stream->width = w; + cur_stream->height = h; } void toggle_pause(void) @@ -2346,10 +2332,7 @@ const OptionDef options[] = { { "h", 0, {(void*)show_help}, "show help" }, { "x", HAS_ARG, {(void*)opt_width}, "force displayed width", "width" }, { "y", HAS_ARG, {(void*)opt_height}, "force displayed height", "height" }, -#if 0 - /* disabled as SDL/X11 does not support it correctly on application launch */ { "fs", OPT_BOOL, {(void*)&is_full_screen}, "force full screen" }, -#endif { "an", OPT_BOOL, {(void*)&audio_disable}, "disable audio" }, { "vn", OPT_BOOL, {(void*)&video_disable}, "disable video" }, { "ss", HAS_ARG, {(void*)&opt_seek}, "seek to a given position in seconds", "pos" }, @@ -2443,19 +2426,10 @@ int main(int argc, char **argv) } if (!display_disable) { -#ifdef HAVE_X11 - /* save the screen resolution... SDL should allow full screen - by resizing the window */ - { - Display *dpy; - dpy = XOpenDisplay(NULL); - if (dpy) { - fs_screen_width = DisplayWidth(dpy, DefaultScreen(dpy)); - fs_screen_height = DisplayHeight(dpy, DefaultScreen(dpy)); - XCloseDisplay(dpy); - } - } -#endif + const SDL_VideoInfo *vi = SDL_GetVideoInfo(); + fs_screen_width = vi->current_w; + fs_screen_height = vi->current_h; + flags = SDL_HWSURFACE|SDL_ASYNCBLIT|SDL_HWACCEL; if (is_full_screen && fs_screen_width) { w = fs_screen_width;