[Mplayer-cvslog] CVS: main/libvo vo_sdl.c,1.76,1.77

Fredrik Kuivinen CVS ksorim at mplayer.dev.hu
Sat Mar 23 11:09:48 CET 2002


Update of /cvsroot/mplayer/main/libvo
In directory mplayer:/var/tmp.root/cvs-serv6557

Modified Files:
	vo_sdl.c 
Log Message:
Fixes crash which occured when it wasn't possible to connect to the display
name in DISPLAY.


Index: vo_sdl.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_sdl.c,v
retrieving revision 1.76
retrieving revision 1.77
diff -u -r1.76 -r1.77
--- vo_sdl.c	22 Mar 2002 07:35:48 -0000	1.76
+++ vo_sdl.c	23 Mar 2002 10:09:39 -0000	1.77
@@ -822,9 +822,9 @@
     priv->format = format;
     
 #ifdef HAVE_X11
-	if(getenv("DISPLAY")) {
+    XDisplay = XOpenDisplay(NULL);
+    if(XDisplay) {
 		if(verbose) printf("SDL: deactivating XScreensaver/DPMS\n");
-		XDisplay = XOpenDisplay(getenv("DISPLAY"));
 		XScreen = DefaultScreen(XDisplay);
 		priv->XWidth = DisplayWidth(XDisplay, XScreen);
 		priv->XHeight = DisplayHeight(XDisplay, XScreen);
@@ -1607,9 +1607,10 @@
 {
 #ifdef HAVE_X11
 	static Display *XDisplay;
-	if(getenv("DISPLAY")) {
+    XDisplay = XOpenDisplay(NULL);
+    if(XDisplay) {
 		if(verbose) printf("SDL: activating XScreensaver/DPMS\n");
-		XDisplay = XOpenDisplay(getenv("DISPLAY"));
+
 		saver_on(XDisplay);
 		XCloseDisplay(XDisplay);
 	}




More information about the MPlayer-cvslog mailing list