summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-07-18 13:11:13 +0200
committerwm4 <wm4@nowhere>2013-07-18 13:11:13 +0200
commit81698e71162a63c3ab046c46daee8761ec0591d8 (patch)
tree417cabcb93c8cef6b282aab4dcb4da231214f8d8
parentd0020db5f33971762a95d4c2ff3a6f69dac0868c (diff)
downloadmpv-81698e71162a63c3ab046c46daee8761ec0591d8.tar.bz2
mpv-81698e71162a63c3ab046c46daee8761ec0591d8.tar.xz
vo_x11: remove weird inactive code
I guess this code was supposed to handle cases like drawing RGBA as ARGB by offsetting it by 1 byte. The code didn't make any sense, though. It used to make sense before mpv switched internal pixel formats from FourCCs to a simple enum. With the FourCCs, "fmt | 128" selected the big endian version of a format. Of course this doesn't work this way with the new pixel formats. It just so happens that there are no formats with whose values match IMGFMT_RGB32|128 or IMGFMT_BGR32|128, so this code was inactive. All involved pixel formats seem to play fine on my setup (though it's little endian only), and the code strictly matches the mpv pixel formats against the format of the X image, so I'm not quite sure why this code was there in the first place. The original commit that added this was b333ae1 (svn 21602): Support for different endianness on client and server with -vo x11
-rw-r--r--video/out/vo_x11.c15
1 files changed, 0 insertions, 15 deletions
diff --git a/video/out/vo_x11.c b/video/out/vo_x11.c
index b86f851334..ccd9e3243a 100644
--- a/video/out/vo_x11.c
+++ b/video/out/vo_x11.c
@@ -73,7 +73,6 @@ struct priv {
uint32_t image_height;
uint32_t in_format;
uint32_t out_format;
- int out_offset;
struct mp_rect src;
struct mp_rect dst;
@@ -384,18 +383,6 @@ static bool resize(struct vo *vo)
}
p->out_format = fmte->mpfmt;
p->bpp = p->myximage[0]->bits_per_pixel;
- p->out_offset = 0;
- // We can easily "emulate" non-native RGB32 and BGR32
- if (p->out_format == (IMGFMT_BGR32 | 128)
- || p->out_format == (IMGFMT_RGB32 | 128))
- {
- p->out_format &= ~128;
-#if BYTE_ORDER == BIG_ENDIAN
- p->out_offset = 1;
-#else
- p->out_offset = -1;
-#endif
- }
p->swsContext = sws_getContextFromCmdLine(p->src_w, p->src_h, p->in_format,
p->dst_w, p->dst_h, p->out_format);
@@ -414,7 +401,6 @@ static void Display_Image(struct priv *p, XImage *myximage)
XImage *x_image = p->myximage[p->current_buf];
- x_image->data += p->out_offset;
#ifdef HAVE_SHM
if (p->Shmem_Flag) {
XShmPutImage(vo->x11->display, vo->x11->window, vo->x11->vo_gc, x_image,
@@ -427,7 +413,6 @@ static void Display_Image(struct priv *p, XImage *myximage)
XPutImage(vo->x11->display, vo->x11->window, vo->x11->vo_gc, x_image,
0, 0, p->dst.x0, p->dst.y0, p->dst_w, p->dst_h);
}
- x_image->data -= p->out_offset;
}
static struct mp_image get_x_buffer(struct priv *p, int buf_index)