Commit 7b337cff authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

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

parent 96067e49
......@@ -3390,6 +3390,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}])
......
......@@ -40,6 +40,13 @@
#include <SDL.h>
#ifndef WIN32
# ifdef X_DISPLAY_MISSING
# error Xlib required due to XInitThreads
# endif
# include <vlc_xlib.h>
#endif
/*****************************************************************************
* Module descriptor
*****************************************************************************/
......@@ -72,7 +79,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 *);
......@@ -109,6 +116,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);
......@@ -326,7 +338,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;
......@@ -426,7 +438,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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment