diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2004-07-09 18:59:55 +0000 |
---|---|---|
committer | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2004-07-09 18:59:55 +0000 |
commit | 6696304efe63dcafa981f08d5324d921dbc3bc42 (patch) | |
tree | d008c55703ae922c748a58c49ba1f47e6b9c5447 | |
parent | 367768db96fec9a2a887be9184fde7ec830c7eac (diff) |
fix for xscreensaver disabling
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12788 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r-- | libvo/vo_sdl.c | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/libvo/vo_sdl.c b/libvo/vo_sdl.c index 91c8943689..59dccde1ab 100644 --- a/libvo/vo_sdl.c +++ b/libvo/vo_sdl.c @@ -1575,13 +1575,10 @@ static void uninit(void) { #ifdef HAVE_X11 - static Display *XDisplay; - XDisplay = XOpenDisplay(NULL); - if(XDisplay) { + struct sdl_priv_s *priv = &sdl_priv; + if(priv->X) { if(verbose) printf("SDL: activating XScreensaver/DPMS\n"); - - saver_on(XDisplay); - XCloseDisplay(XDisplay); + vo_x11_uninit(); } #endif sdl_close(); @@ -1597,10 +1594,6 @@ uninit(void) static uint32_t preinit(const char *arg) { struct sdl_priv_s *priv = &sdl_priv; -#ifdef HAVE_X11 - static Display *XDisplay; - static int XScreen; -#endif priv->rgbsurface = NULL; priv->overlay = NULL; @@ -1635,16 +1628,12 @@ static uint32_t preinit(const char *arg) priv->X = 0; #ifdef HAVE_X11 - XDisplay = XOpenDisplay(NULL); - if(XDisplay) { + if(vo_init()) { if(verbose) printf("SDL: deactivating XScreensaver/DPMS\n"); - XScreen = DefaultScreen(XDisplay); - priv->XWidth = DisplayWidth(XDisplay, XScreen); - priv->XHeight = DisplayHeight(XDisplay, XScreen); + priv->XWidth = vo_screenwidth; + priv->XHeight = vo_screenheight; priv->X = 1; if(verbose) printf("SDL: X11 Resolution %ix%i\n", priv->XWidth, priv->XHeight); - saver_off(XDisplay); - XCloseDisplay(XDisplay); } #endif |