changeset 27762:7efce8fe3a04

fixed image format detection for 15 bit color depths
author faust3
date Fri, 17 Oct 2008 10:01:44 +0000
parents b9bf90af1ceb
children eea0247a150b
files libvo/vo_x11.c
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/vo_x11.c	Thu Oct 16 20:44:05 2008 +0000
+++ b/libvo/vo_x11.c	Fri Oct 17 10:01:44 2008 +0000
@@ -480,7 +480,13 @@
     }
 
     while (fmte->mpfmt) {
-      if (IMGFMT_RGB_DEPTH(fmte->mpfmt) == myximage->bits_per_pixel &&
+      int depth = IMGFMT_RGB_DEPTH(fmte->mpfmt);
+      /* bits_per_pixel in X seems to be set to 16 for 15 bit formats
+         => force depth to 16 so that only the color masks are used for the format check */
+      if (depth == 15)
+          depth = 16;
+
+      if (depth            == myximage->bits_per_pixel &&
           fmte->byte_order == myximage->byte_order &&
           fmte->red_mask   == myximage->red_mask   &&
           fmte->green_mask == myximage->green_mask &&