summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/ffv1enc.c4
1 files changed, 2 insertions, 2 deletions
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) {