]> git.sesse.net Git - vlc/blobdiff - modules/audio_output/pulse.c
Pulse: uses Xlib, needs XInitThreads()
[vlc] / modules / audio_output / pulse.c
index c4580b62af14e71e8e25a23d3d1bf32b9b529cbc..adc32d636d2805868c6dc9792a32101e92df8c9c 100644 (file)
@@ -34,6 +34,9 @@
 #include <vlc_cpu.h>
 
 #include <pulse/pulseaudio.h>
+#ifdef HAVE_X11_XLIB_H
+# include <X11/Xlib.h>
+#endif
 
 #include <assert.h>
 
@@ -119,6 +122,10 @@ static int Open ( vlc_object_t *p_this )
     struct pa_buffer_attr a;
     struct pa_channel_map map;
 
+#ifdef HAVE_X11_XLIB_H
+    if( !XInitThreads() )
+        return VLC_EGENERIC;
+#endif
     /* Allocate structures */
     p_aout->output.p_sys = p_sys = calloc( 1, sizeof( aout_sys_t ) );
     if( p_sys == NULL )