This is needed to protect the Xlib internal state. Xlib may still be
used by user interface thread, the GLX video output thread(s) and
PulseAudio -audio thread- while it initializes.
Fortunately, we do not need to lock X11 displays as every thread uses
its own. Hopefully Xlib is not buggy in that respect, but I am not so
sure :(
This should fix LP #419915.
intf_sys_t *p_sys;;
vlc_value_t val;
+ if( !XInitThreads() )
+ return VLC_EGENERIC;
+
/* Allocate instance and initialize some members */
p_intf->p_sys = p_sys = malloc( sizeof( intf_sys_t ) );
if( p_intf->p_sys == NULL )
intf_thread_t *p_intf = (intf_thread_t *)p_this;
#ifdef Q_WS_X11
+ if( !XInitThreads() )
+ return VLC_EGENERIC;
x11_display = var_CreateGetNonEmptyString( p_intf, "x11-display" );
Display *p_display = XOpenDisplay( x11_display );
if( !p_display )