From 16d22ea02a66f0f80c0e568381d8d9a4342362c5 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 15 Aug 2017 17:03:35 +0200 Subject: img_format: better exclusion of bayer formats These are useless and shouldn't be confused with normal RGB formats. Replace the earlier hack checking the format name with a proper check. (Not sure when this flag was added. Libav won't have it anyway, but also no bayer formats.) --- video/img_format.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'video/img_format.c') diff --git a/video/img_format.c b/video/img_format.c index e89734031c..61485549e7 100644 --- a/video/img_format.c +++ b/video/img_format.c @@ -438,8 +438,13 @@ bool mp_get_regular_imgfmt(struct mp_regular_imgfmt *dst, int imgfmt) res.chroma_w = 1 << pixdesc->log2_chroma_w; res.chroma_h = 1 << pixdesc->log2_chroma_h; +#if AV_PIX_FMT_FLAG_BAYER + if (pixdesc->flags & AV_PIX_FMT_FLAG_BAYER) + return false; // it's satan himself +#else if (strncmp(pixdesc->name, "bayer_", 6) == 0) return false; // it's satan himself +#endif if (!validate_regular_imgfmt(&res)) return false; -- cgit v1.2.3