+ Display *p_display; /* display pointer */
+ char *psz_display;
+
+ /* Open display, unsing 'vlc_display' or DISPLAY environment variable */
+ psz_display = XDisplayName( main_GetPszVariable(VOUT_DISPLAY_VAR, NULL) );
+ p_display = XOpenDisplay( psz_display );
+ if( p_display == NULL ) /* error */
+ {
+ intf_WarnMsg( 3, "vout: Xvideo cannot open display %s", psz_display );
+ intf_WarnMsg( 3, "vout: Xvideo not supported" );
+ return( 0 );
+ }
+
+ if( !XVideoCheckForXv( p_display ) )
+ {
+ intf_WarnMsg( 3, "vout: Xvideo not supported" );
+ XCloseDisplay( p_display );
+ return( 0 );
+ }
+
+ if( XVideoGetPort( p_display ) < 0 )
+ {
+ intf_WarnMsg( 3, "vout: Xvideo not supported" );
+ XCloseDisplay( p_display );
+ return( 0 );
+ }
+
+ /* Clean-up everyting */
+ XCloseDisplay( p_display );
+