changeset 5267:e5f57c576c48

Fixes crash which occured when it wasn't possible to connect to the display name in DISPLAY.
author ksorim
date Sat, 23 Mar 2002 10:09:39 +0000
parents 413e450da31c
children 6280f4ac324f
files libvo/vo_sdl.c
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/vo_sdl.c	Sat Mar 23 02:41:31 2002 +0000
+++ b/libvo/vo_sdl.c	Sat Mar 23 10:09:39 2002 +0000
@@ -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);
 	}