summaryrefslogtreecommitdiffstats
path: root/libvo
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-12-12 18:43:10 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-12-12 18:43:10 +0000
commitfa9a9cb0e353c54c31887842c353df96e120fee3 (patch)
treedc76fdcdc1d769f6f954e76102bb748ea37954cc /libvo
parenta0d986709957ffcf8aa27e75d9c2210a12838b94 (diff)
downloadmpv-fa9a9cb0e353c54c31887842c353df96e120fee3.tar.bz2
mpv-fa9a9cb0e353c54c31887842c353df96e120fee3.tar.xz
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). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21600 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo')
-rw-r--r--libvo/vo_x11.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/libvo/vo_x11.c b/libvo/vo_x11.c
index 306a578f2a..09e491c613 100644
--- a/libvo/vo_x11.c
+++ b/libvo/vo_x11.c
@@ -229,9 +229,10 @@ static void getMyXImage(void)
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 @@ static void freeMyXImage(void)
XDestroyImage(myximage);
}
myximage = NULL;
+ ImageData = NULL;
}
#ifdef WORDS_BIGENDIAN