0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 12:02:23 +02:00

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.)
This commit is contained in:
wm4 2017-08-15 17:03:35 +02:00
parent 63b1031ca2
commit 16d22ea02a

View File

@ -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;