summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPetri Hintukainen <phintuka@users.sourceforge.net>2014-04-30 12:49:35 +0300
committerPetri Hintukainen <phintuka@users.sourceforge.net>2014-04-30 12:49:35 +0300
commite27a23fa6f14dde0f26fd3aba249128b4d47e55e (patch)
treee30ccad964767a55c39433003ffaeb2e30912e11 /src
parent6c59c4c763d9f74b87db18e00ebf8a5e733bcfbc (diff)
downloadxine-lib-e27a23fa6f14dde0f26fd3aba249128b4d47e55e.tar.gz
xine-lib-e27a23fa6f14dde0f26fd3aba249128b4d47e55e.tar.bz2
video_out_sdl: remove some build-time HAVE_X11 checks or change those to run-time deps.
SDL video output works perfectly well under X11 even if xine-lib was built without X11 support.
Diffstat (limited to 'src')
-rw-r--r--src/video_out/video_out_sdl.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/video_out/video_out_sdl.c b/src/video_out/video_out_sdl.c
index 6058cd57d..a539f8827 100644
--- a/src/video_out/video_out_sdl.c
+++ b/src/video_out/video_out_sdl.c
@@ -64,6 +64,7 @@
#include <xine/xineutils.h>
#include <xine/vo_scale.h>
+#undef HAVE_X11
#ifdef HAVE_X11
#include <X11/Xlib.h>
#endif
@@ -271,7 +272,7 @@ static int sdl_redraw_needed (vo_driver_t *this_gen) {
sdl_driver_t *this = (sdl_driver_t *) this_gen;
int ret = 0;
-#ifdef HAVE_X11
+ if (this->sc.frame_output_cb) {
if( _x_vo_scale_redraw_needed( &this->sc ) ) {
@@ -282,7 +283,7 @@ static int sdl_redraw_needed (vo_driver_t *this_gen) {
return ret;
-#else
+ } else {
if( this->last_gui_width != this->sc.gui_width ||
this->last_gui_height != this->sc.gui_height ||
@@ -300,7 +301,7 @@ static int sdl_redraw_needed (vo_driver_t *this_gen) {
return ret;
-#endif
+ }
}
@@ -463,10 +464,8 @@ static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *vi
sdl_driver_t *this;
const SDL_VideoInfo *vidInfo;
-#if defined(HAVE_X11) || defined(WIN32)
static char SDL_windowhack[32];
x11_visual_t *visual = (x11_visual_t *) visual_gen;
-#endif
#ifdef HAVE_X11
XWindowAttributes window_attributes;
#endif
@@ -492,18 +491,17 @@ static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *vi
this->xine = class->xine;
_x_vo_scale_init( &this->sc, 0, 0, config);
-#ifdef HAVE_X11
+
+ if (visual) {
this->sc.frame_output_cb = visual->frame_output_cb;
this->sc.user_data = visual->user_data;
-#endif
-#if defined(HAVE_X11) || defined(WIN32)
/* set SDL to use our existing X11/win32 window */
if (visual->d){
sprintf(SDL_windowhack,"SDL_WINDOWID=0x%x", (uint32_t) visual->d);
putenv(SDL_windowhack);
}
-#endif
+ }
if ((SDL_Init (SDL_INIT_VIDEO)) < 0) {
xprintf (this->xine, XINE_VERBOSITY_DEBUG, "video_out_sdl: open_plugin - sdl video initialization failed.\n");