summaryrefslogtreecommitdiffstats
path: root/video/img_format.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-08-15 17:03:35 +0200
committerwm4 <wm4@nowhere>2017-08-15 17:03:35 +0200
commit16d22ea02a66f0f80c0e568381d8d9a4342362c5 (patch)
tree095a57eac1d4dba7dec11e2c2539ba2962b26cbf /video/img_format.c
parent63b1031ca2bb57ce101de274fbe3cbe16ff5222f (diff)
downloadmpv-16d22ea02a66f0f80c0e568381d8d9a4342362c5.tar.bz2
mpv-16d22ea02a66f0f80c0e568381d8d9a4342362c5.tar.xz
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.)
Diffstat (limited to 'video/img_format.c')
-rw-r--r--video/img_format.c5
1 files changed, 5 insertions, 0 deletions
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;