[MPlayer-dev-eng] [PATCH] make vo_x11 work if server and client endianness differ
Reimar D?ffinger
Reimar.Doeffinger at stud.uni-karlsruhe.de
Sat Dec 9 19:43:17 CET 2006
Hello,
attached patch does as subject says, though it could be considered a bit
hackish. It works fine for me though, so I intend to commit.
A better fix would probably be to add support for non-native-endian RGB32 format,
but I am not motivated to do that.
Greetings,
Reimar Döffinger
-------------- next part --------------
Index: libvo/vo_x11.c
===================================================================
--- libvo/vo_x11.c (revision 21549)
+++ libvo/vo_x11.c (working copy)
@@ -83,6 +83,7 @@
static uint32_t image_height;
static uint32_t in_format;
static uint32_t out_format = 0;
+static int out_offset = 0;
static int srcW = -1;
static int srcH = -1;
static int aspect; // 1<<16 based fixed point aspect, so that the aspect stays correct during resizing
@@ -545,6 +546,10 @@
default:
draw_alpha_fnc = draw_alpha_null;
}
+ if (out_format & 64 && IMGFMT_IS_RGB(out_format) || IMGFMT_IS_BGR(out_format)) {
+ out_format &= ~64;
+ out_offset = 1;
+ }
/* always allocate swsContext as size could change between frames */
swsContext =
@@ -564,6 +569,7 @@
static void Display_Image(XImage * myximage, uint8_t * ImageData)
{
+ myximage->data += out_offset;
#ifdef HAVE_SHM
if (Shmem_Flag)
{
@@ -581,6 +587,7 @@
(vo_dheight - myximage->height) / 2, dst_width,
myximage->height);
}
+ myximage->data -= out_offset;
}
static void draw_osd(void)
More information about the MPlayer-dev-eng
mailing list