changeset 33434:229982126641

Fix xv/xvmc window background clearing. Set background color only when using ck-method=background. In the other cases clearing of the non-video image area should be done manually. Not drawing on the video image area prevents flickering (visible when resizing).
author iive
date Sun, 29 May 2011 22:46:52 +0000
parents a010c375947c
children f7a492ac8d30
files libvo/vo_xv.c libvo/vo_xvmc.c
diffstat 2 files changed, 9 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/vo_xv.c	Sun May 29 22:41:52 2011 +0000
+++ b/libvo/vo_xv.c	Sun May 29 22:46:52 2011 +0000
@@ -168,7 +168,7 @@
 static void resize(void)
 {
     calc_src_dst_rects(image_width, image_height, &src_rect, &dst_rect, NULL, NULL);
-    vo_x11_clearwindow_part(mDisplay, vo_window, dst_rect.width, dst_rect.height, vo_fs);
+//    vo_x11_clearwindow_part(mDisplay, vo_window, dst_rect.width, dst_rect.height, vo_fs);
     vo_xv_draw_colorkey(dst_rect.left, dst_rect.top, dst_rect.width, dst_rect.height);
 }
 
@@ -240,13 +240,13 @@
             depth = 24;
         XMatchVisualInfo(mDisplay, mScreen, depth, TrueColor, &vinfo);
 
-        xswa.background_pixel = 0;
+        xswa.border_pixel = 0;
+        xswamask = CWBorderPixel;
         if (xv_ck_info.method == CK_METHOD_BACKGROUND)
         {
           xswa.background_pixel = xv_colorkey;
+          xswamask |= CWBackPixel;
         }
-        xswa.border_pixel = 0;
-        xswamask = CWBackPixel | CWBorderPixel;
 
             vo_x11_create_vo_window(&vinfo, vo_dx, vo_dy, vo_dwidth, vo_dheight,
                    flags, CopyFromParent, "xv", title);
--- a/libvo/vo_xvmc.c	Sun May 29 22:41:52 2011 +0000
+++ b/libvo/vo_xvmc.c	Sun May 29 22:46:52 2011 +0000
@@ -666,11 +666,12 @@
         if (depth != 15 && depth != 16 && depth != 24 && depth != 32) depth = 24;
         XMatchVisualInfo(mDisplay, mScreen, depth, TrueColor, &vinfo);
 
-        xswa.background_pixel = 0;
-        if (xv_ck_info.method == CK_METHOD_BACKGROUND)
+        xswa.border_pixel     = 0;
+        xswamask = CWBorderPixel;
+        if (xv_ck_info.method == CK_METHOD_BACKGROUND){
             xswa.background_pixel = xv_colorkey;
-        xswa.border_pixel     = 0;
-        xswamask = CWBackPixel | CWBorderPixel;
+            xswamask |= CWBackPixel;
+        }
 
         vo_x11_create_vo_window(&vinfo, vo_dx, vo_dy, d_width, d_height, flags,
                                 CopyFromParent, "xvmc", title);