Use --x11-display whenever calling XOpenDisplay (except Qt4 this far)
[vlc.git] / modules / access / screen / x11.c
index f630cec..177f382 100644 (file)
@@ -41,11 +41,13 @@ int screen_InitCapture( demux_t *p_demux )
 {
     demux_sys_t *p_sys = p_demux->p_sys;
     Display *p_display;
+    char *psz_display = var_CreateGetNonEmptyString( p_demux, "x11-display" );
     XWindowAttributes win_info;
     int i_chroma;
 
     /* Open the display */
-    p_display = XOpenDisplay( NULL );
+    p_display = XOpenDisplay( psz_display );
+    free( psz_display );
     if( !p_display )
     {
         msg_Err( p_demux, "cannot open display" );
@@ -108,7 +110,7 @@ int screen_CloseCapture( demux_t *p_demux )
     XCloseDisplay( p_display );
     if( p_sys->p_blend )
     {
-        module_Unneed( p_sys->p_blend, p_sys->p_blend->p_module );
+        module_unneed( p_sys->p_blend, p_sys->p_blend->p_module );
         vlc_object_detach( p_sys->p_blend );
         vlc_object_release( p_sys->p_blend );
     }