[vlc-commits] commit: SDL vout: fix crash due to (not calling) XInitThreads ( Rémi Denis-Courmont )

git at videolan.org git at videolan.org
Mon Jul 12 19:57:07 CEST 2010


vlc/vlc-1.1 | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Jul 12 20:53:56 2010 +0300| [f554fa3a523865e51d8fc6fb37c726e0fd370a95] | committer: Rémi Denis-Courmont 

SDL vout: fix crash due to (not calling) XInitThreads

(cherry picked from commit 7b337cff1e4ef7bcfd12ba5b0601cb62b44e793b)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-1.1.git/?a=commit;h=f554fa3a523865e51d8fc6fb37c726e0fd370a95
---

 configure.ac               |    3 +++
 modules/video_output/sdl.c |   18 +++++++++++++++---
 2 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index fc736e9..83c5231 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3423,6 +3423,9 @@ then
       if test "${SYS}" != "darwin"; then
         VLC_ADD_PLUGIN([vout_sdl aout_sdl])
       fi
+      if test "${SYS}" != "mingw32"; then
+        VLC_ADD_LIBS([vout_sdl],[${X_LIBS} ${X_PRE_LIBS} -lX11])
+      fi
       VLC_ADD_CFLAGS([vout_sdl aout_sdl],[${SDL_CFLAGS}])
       VLC_ADD_LIBS([vout_sdl aout_sdl],[${SDL_LIBS}])
 
diff --git a/modules/video_output/sdl.c b/modules/video_output/sdl.c
index fc372bf..beb01ef 100644
--- a/modules/video_output/sdl.c
+++ b/modules/video_output/sdl.c
@@ -41,6 +41,13 @@
 
 #include <SDL.h>
 
+#ifndef WIN32
+# ifdef X_DISPLAY_MISSING
+#  error Xlib required due to XInitThreads
+# endif
+# include <vlc_xlib.h>
+#endif
+
 /*****************************************************************************
  * Module descriptor
  *****************************************************************************/
@@ -73,7 +80,7 @@ vlc_module_end()
  * Local prototypes
  *****************************************************************************/
 static picture_pool_t *Pool  (vout_display_t *, unsigned);
-static void           Display(vout_display_t *, picture_t *);
+static void           PictureDisplay(vout_display_t *, picture_t *);
 static int            Control(vout_display_t *, int, va_list);
 static void           Manage(vout_display_t *);
 
@@ -111,6 +118,11 @@ static int Open(vlc_object_t *object)
     vout_display_t *vd = (vout_display_t *)object;
     vout_display_sys_t *sys;
 
+#ifndef WIN32
+    if (!vlc_xlib_init (object))
+        return VLC_EGENERIC;
+#endif
+
     /* XXX: check for conflicts with the SDL audio output */
     vlc_mutex_lock(&sdl_lock);
 
@@ -327,7 +339,7 @@ static int Open(vlc_object_t *object)
 
     vd->pool    = Pool;
     vd->prepare = NULL;
-    vd->display = Display;
+    vd->display = PictureDisplay;
     vd->control = Control;
     vd->manage  = Manage;
 
@@ -431,7 +443,7 @@ static picture_pool_t *Pool(vout_display_t *vd, unsigned count)
 /**
  * Display a picture
  */
-static void Display(vout_display_t *vd, picture_t *p_pic)
+static void PictureDisplay(vout_display_t *vd, picture_t *p_pic)
 {
     vout_display_sys_t *sys = vd->sys;
 



More information about the vlc-commits mailing list