Commit aa1d5649 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

XCB/XVideo: allow mixed endian format if 8 or 4 bits per component

Mixed endianess is only an issue if the component values are not
aligned inside octets. This fixes Debian #604687.
parent dbcc7fad
...@@ -134,9 +134,6 @@ static bool CheckXVideo (vout_display_t *vd, xcb_connection_t *conn) ...@@ -134,9 +134,6 @@ static bool CheckXVideo (vout_display_t *vd, xcb_connection_t *conn)
static vlc_fourcc_t ParseFormat (vlc_object_t *obj, static vlc_fourcc_t ParseFormat (vlc_object_t *obj,
const xcb_xv_image_format_info_t *restrict f) const xcb_xv_image_format_info_t *restrict f)
{ {
if (f->byte_order != ORDER && f->bpp != 8)
return 0; /* Argh! */
switch (f->type) switch (f->type)
{ {
case XCB_XV_IMAGE_FORMAT_INFO_TYPE_RGB: case XCB_XV_IMAGE_FORMAT_INFO_TYPE_RGB:
...@@ -154,10 +151,14 @@ static vlc_fourcc_t ParseFormat (vlc_object_t *obj, ...@@ -154,10 +151,14 @@ static vlc_fourcc_t ParseFormat (vlc_object_t *obj,
return VLC_CODEC_RGB24; return VLC_CODEC_RGB24;
break; break;
case 16: case 16:
if (f->byte_order != ORDER)
return 0; /* Mixed endian! */
if (f->bpp == 16 && f->depth == 16) if (f->bpp == 16 && f->depth == 16)
return VLC_CODEC_RGB16; return VLC_CODEC_RGB16;
break; break;
case 15: case 15:
if (f->byte_order != ORDER)
return 0; /* Mixed endian! */
if (f->bpp == 16 && f->depth == 16) if (f->bpp == 16 && f->depth == 16)
return VLC_CODEC_RGBT; return VLC_CODEC_RGBT;
if (f->bpp == 16 && f->depth == 15) if (f->bpp == 16 && f->depth == 15)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment