mirror of https://github.com/mpv-player/mpv
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
This commit is contained in:
parent
d0020db5f3
commit
81698e7116
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue