changeset 21584:3ddf91e141a3

Use XCreateImage instead of XGetImage, this is not only more correct and similar to the SHM case, it also eliminates the massive startup delay over ssh (at least when you have a tiny upstream).
author reimar
date Tue, 12 Dec 2006 18:43:10 +0000
parents f746c28a324c
children e54f539c9b5d
files libvo/vo_x11.c
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/vo_x11.c	Tue Dec 12 09:40:49 2006 +0000
+++ b/libvo/vo_x11.c	Tue Dec 12 18:43:10 2006 +0000
@@ -229,9 +229,10 @@
       shmemerror:
         Shmem_Flag = 0;
 #endif
-        myximage = XGetImage(mDisplay, vo_window, 0, 0,
-                             image_width, image_height, AllPlanes,
-                             ZPixmap);
+        myximage = XCreateImage(mDisplay, vinfo.visual, depth, ZPixmap,
+                             0, NULL, image_width, image_height, 8, 0);
+        myximage->data = malloc(myximage->bytes_per_line * image_height);
+        memset(myximage->data, 0, myximage->bytes_per_line * image_height);
         ImageData = myximage->data;
 #ifdef HAVE_SHM
     }
@@ -252,6 +253,7 @@
         XDestroyImage(myximage);
     }
     myximage = NULL;
+    ImageData = NULL;
 }
 
 #ifdef WORDS_BIGENDIAN