From cdeb0e4c72cd9c0ebed233bcee80d19250d57550 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 1 Nov 2015 14:11:43 +0100 Subject: 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. --- video/img_format.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'video/img_format.c') diff --git a/video/img_format.c b/video/img_format.c index c2bbf6bb01..332bf3676f 100644 --- a/video/img_format.c +++ b/video/img_format.c @@ -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++) { -- cgit v1.2.3