From 921073bf8645ed9e74e8e2463d2a6f6ab9c7bfe6 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 6 Nov 2017 17:14:01 +0100 Subject: [PATCH] img_format: remove some guards against old ffmpeg API These are always present in ffmpeg-mpv, and never in Libav. --- video/img_format.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/video/img_format.c b/video/img_format.c index 52319104df..12822b176f 100644 --- a/video/img_format.c +++ b/video/img_format.c @@ -345,7 +345,7 @@ enum mp_component_type mp_imgfmt_get_component_type(int imgfmt) if (!pixdesc) return MP_COMPONENT_TYPE_UNKNOWN; -#ifdef AV_PIX_FMT_FLAG_FLOAT +#if LIBAVUTIL_VERSION_MICRO >= 100 if (pixdesc->flags & AV_PIX_FMT_FLAG_FLOAT) return MP_COMPONENT_TYPE_FLOAT; #endif @@ -441,12 +441,9 @@ 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; -#ifdef AV_PIX_FMT_FLAG_BAYER +#if LIBAVUTIL_VERSION_MICRO >= 100 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))