video: fix playback of pal8

PAL8 is the only format that is RGB, has only 1 component, is byte-
aligned. It was accidentally detected by the GBRP case as planar RGB.
(It would have been ok if it were gray; what ruins it is that it's
actually paletted, and the color values do not correspond to colors (but
palette entries).

Pseudo-pal formats are ok; in fact AV_PIX_FMT_GRAY is rightfully marked
as MP_IMGFLAG_YUV_P.
This commit is contained in:
wm4 2015-11-01 14:11:43 +01:00
parent 8fd63c8f0c
commit cdeb0e4c72
1 changed files with 2 additions and 1 deletions

View File

@ -232,7 +232,8 @@ struct mp_imgfmt_desc mp_imgfmt_get_desc(int mpfmt)
desc.flags |= MP_IMGFLAG_PAL;
if ((desc.flags & (MP_IMGFLAG_YUV | MP_IMGFLAG_RGB))
&& (desc.flags & MP_IMGFLAG_BYTE_ALIGNED))
&& (desc.flags & MP_IMGFLAG_BYTE_ALIGNED)
&& !(pd->flags & AV_PIX_FMT_FLAG_PAL))
{
bool same_depth = true;
for (int p = 0; p < desc.num_planes; p++) {