From 7033654f7f3c6663c9b5005b87fc06c29075244d Mon Sep 17 00:00:00 2001 From: Marton Balint Date: Thu, 19 Apr 2018 23:14:24 +0200 Subject: Use AV_PIX_FMT_FLAG_ALPHA for detecting transparency where nb_components was used Temporarily keep the old method for ffmpeg_filters.c choose_pix_fmt and avfiltergraph.c pick_format() until a paletted pixel format without alpha is introduced. Signed-off-by: Marton Balint --- libavcodec/ffv1enc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libavcodec') diff --git a/libavcodec/ffv1enc.c b/libavcodec/ffv1enc.c index 23e8d3dfa4..e6f4422fa1 100644 --- a/libavcodec/ffv1enc.c +++ b/libavcodec/ffv1enc.c @@ -624,7 +624,7 @@ FF_ENABLE_DEPRECATION_WARNINGS case AV_PIX_FMT_YUVA420P: s->chroma_planes = desc->nb_components < 3 ? 0 : 1; s->colorspace = 0; - s->transparency = desc->nb_components == 4 || desc->nb_components == 2; + s->transparency = !!(desc->flags & AV_PIX_FMT_FLAG_ALPHA); if (!avctx->bits_per_raw_sample && !s->bits_per_raw_sample) s->bits_per_raw_sample = 8; else if (!s->bits_per_raw_sample) @@ -676,7 +676,7 @@ FF_ENABLE_DEPRECATION_WARNINGS s->bits_per_raw_sample = 16; else if (!s->bits_per_raw_sample) s->bits_per_raw_sample = avctx->bits_per_raw_sample; - s->transparency = desc->nb_components == 4 || desc->nb_components == 2; + s->transparency = !!(desc->flags & AV_PIX_FMT_FLAG_ALPHA); s->colorspace = 1; s->chroma_planes = 1; if (s->bits_per_raw_sample >= 16) { -- cgit v1.2.3