changeset 1794:fa2b852f494d

add dealloc func
author pontscho
date Fri, 31 Aug 2001 10:06:32 +0000
parents ba11d77c587a
children 4dde03edb55e
files libvo/vo_xv.c
diffstat 1 files changed, 19 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/vo_xv.c	Thu Aug 30 23:11:06 2001 +0000
+++ b/libvo/vo_xv.c	Fri Aug 31 10:06:32 2001 +0000
@@ -263,7 +263,9 @@
        drwHeight=(dheight > vo_screenheight?vo_screenheight:dheight);
        printf( "[xv-fs] dcx: %d dcy: %d dx: %d dy: %d dw: %d dh: %d\n",drwcX,drwcY,drwX,drwY,drwWidth,drwHeight );
       }
-
+#ifdef HAVE_NEW_GUI
+     if ( vo_window == None )
+#endif
      saver_off(mDisplay);  // turning off screen saver
      return 0;
     }
@@ -297,6 +299,15 @@
  return;
 }
 
+static void deallocate_xvimage(int foo)
+{
+ XShmDetach( mDisplay,&Shminfo[foo] );
+ shmdt( Shminfo[foo].shmaddr );
+ XFlush( mDisplay );
+ XSync(mDisplay, False);
+ return;
+}
+
 static void check_events(void)
 {
  int e=vo_x11_check_events(mDisplay);
@@ -451,7 +462,13 @@
 }
 
 static void uninit(void) {
-    saver_on(mDisplay); // screen saver back on
+int i;
+#ifdef HAVE_NEW_GUI
+     if ( vo_window == None )
+#endif
+      saver_on(mDisplay); // screen saver back on
+for( i=0;i<num_buffers;i++ )
+ deallocate_xvimage( i );
 }