mirror of
https://github.com/mpv-player/mpv
synced 2024-12-27 01:22:30 +00:00
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:
parent
8fd63c8f0c
commit
cdeb0e4c72
@ -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++) {
|
||||
|
Loading…
Reference in New Issue
Block a user