[MPlayer-dev-eng] [PATCH] remove duplicate saver_on / saver_off in vos

Reimar Döffinger Reimar.Doeffinger at rz.uni-karlsruhe.de
Sat Jun 26 22:27:45 CEST 2004


Hi,
vo_init and vo_x11_uninit call saver_off and respectively saver_on.
The following patch removes explicit calls to them from vos using
x11_common.c (vo_init is called from preinit, vo_x11_uninit from
uninit by these vos).
preinit for vo_xmga is in mga_common.c, vo_sdl doesn't use these
x11_common functions, so I left it unchanged.

Greetings,
Reimar Doeffinger
-------------- next part --------------
Index: vo_gl.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_gl.c,v
retrieving revision 1.42
diff -u -u -r1.42 vo_gl.c
--- vo_gl.c	8 May 2004 21:38:41 -0000	1.42
+++ vo_gl.c	25 Jun 2004 14:33:14 -0000
@@ -268,8 +268,6 @@
 
 //  printf("OpenGL setup OK!\n");
 
-      saver_off(mDisplay);  // turning off screen saver
-
       if (vo_ontop) vo_x11_setlayer(mDisplay, vo_window, vo_ontop);
 
 	return 0;
@@ -355,7 +353,6 @@
 uninit(void)
 {
   if ( !vo_config_count ) return;
-  saver_on(mDisplay); // screen saver back on
   vo_x11_uninit();
 }
 
Index: vo_gl2.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_gl2.c,v
retrieving revision 1.45
diff -u -u -r1.45 vo_gl2.c
--- vo_gl2.c	8 May 2004 23:53:20 -0000	1.45
+++ vo_gl2.c	25 Jun 2004 14:33:14 -0000
@@ -1009,7 +1009,6 @@
   if (initGl(d_width, d_height) == -1)
       return -1;
 #ifndef GL_WIN32
-      saver_off(mDisplay);
       if (vo_ontop) vo_x11_setlayer(mDisplay,vo_window, vo_ontop);
 #endif
 
Index: vo_x11.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_x11.c,v
retrieving revision 1.138
diff -u -u -r1.138 vo_x11.c
--- vo_x11.c	14 Jun 2004 04:53:02 -0000	1.138
+++ vo_x11.c	25 Jun 2004 14:33:14 -0000
@@ -535,8 +535,6 @@
     }
 #endif
 
-    saver_off(mDisplay);
-
     if (vo_ontop)
         vo_x11_setlayer(mDisplay, vo_window, vo_ontop);
 
@@ -724,7 +722,6 @@
         return;
 
     freeMyXImage();
-    saver_on(mDisplay);         // screen saver back on
 
 #ifdef HAVE_XF86VM
     vo_vm_close(mDisplay);
Index: vo_xmga.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_xmga.c,v
retrieving revision 1.87
diff -u -u -r1.87 vo_xmga.c
--- vo_xmga.c	14 Jun 2004 04:53:03 -0000	1.87
+++ vo_xmga.c	25 Jun 2004 14:33:14 -0000
@@ -272,8 +272,6 @@
 
     set_window();               // set up mga_vid_config.dest_width etc
 
-    saver_off(mDisplay);
-
     if (vo_ontop)
         vo_x11_setlayer(mDisplay, vo_window, vo_ontop);
 
@@ -292,6 +290,5 @@
     if (!inited)
         return;                 // no window?
     inited = 0;
-    saver_on(mDisplay);
     vo_x11_uninit();            // destroy the window
 }
Index: vo_xover.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_xover.c,v
retrieving revision 1.6
diff -u -u -r1.6 vo_xover.c
--- vo_xover.c	30 Nov 2003 16:36:10 -0000	1.6
+++ vo_xover.c	25 Jun 2004 14:33:14 -0000
@@ -352,8 +352,6 @@
 
   panscan_calc();
 
-  saver_off(mDisplay); /* turning off screen saver */
-
   return(0);
 }
 
@@ -404,7 +402,6 @@
   if(!vo_config_count) return;
   if(sub_vo) sub_vo->uninit();
   sub_vo = NULL;
-  saver_on(mDisplay); /* screen saver back on */
   vo_x11_uninit();
   // Restore our callbacks
   video_out_xover.draw_frame = draw_frame;
Index: vo_xv.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_xv.c,v
retrieving revision 1.152
diff -u -u -r1.152 vo_xv.c
--- vo_xv.c	14 Jun 2004 04:53:03 -0000	1.152
+++ vo_xv.c	25 Jun 2004 14:33:14 -0000
@@ -448,8 +448,6 @@
     mp_msg(MSGT_VO, MSGL_V, "[xv] dx: %d dy: %d dw: %d dh: %d\n", drwX,
            drwY, vo_dwidth, vo_dheight);
 
-    saver_off(mDisplay);        // turning off screen saver
-
     if (vo_ontop)
         vo_x11_setlayer(mDisplay, vo_window, vo_ontop);
 
@@ -765,7 +763,6 @@
         return;
     XvFreeAdaptorInfo(ai);
     ai = NULL;
-    saver_on(mDisplay);         // screen saver back on
     for (i = 0; i < num_buffers; i++)
         deallocate_xvimage(i);
 #ifdef HAVE_XF86VM
Index: vo_xvidix.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_xvidix.c,v
retrieving revision 1.67
diff -u -u -r1.67 vo_xvidix.c
--- vo_xvidix.c	14 Jun 2004 04:53:03 -0000	1.67
+++ vo_xvidix.c	25 Jun 2004 14:33:14 -0000
@@ -419,8 +419,6 @@
     if (vo_ontop)
         vo_x11_setlayer(mDisplay, vo_window, vo_ontop);
 
-    saver_off(mDisplay);        /* turning off screen saver */
-
     return (0);
 }
 
@@ -489,7 +487,6 @@
         vidix_name = NULL;
     }
 
-    saver_on(mDisplay);         /* screen saver back on */
     vo_x11_uninit();
 }
 
Index: vo_xvmc.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_xvmc.c,v
retrieving revision 1.9
diff -u -u -r1.9 vo_xvmc.c
--- vo_xvmc.c	30 Nov 2003 16:36:10 -0000	1.9
+++ vo_xvmc.c	25 Jun 2004 14:33:15 -0000
@@ -794,7 +794,6 @@
 
    if (vo_ontop) vo_x11_setlayer(mDisplay, vo_window, vo_ontop);
 
-   saver_off(mDisplay);  // turning off screen saver
 //end vo_xv
 
    /* store image dimesions for displaying */
@@ -1208,7 +1207,6 @@
    if( verbose > 3 ) printf("vo_xvmc: uninit called\n");
    xvmc_free();
  //from vo_xv
-   saver_on(mDisplay);
    vo_vm_close(mDisplay);
    vo_x11_uninit();
 }


More information about the MPlayer-dev-eng mailing list