diff options
author | Marton Balint <cus@passwd.hu> | 2018-04-19 23:14:24 +0200 |
---|---|---|
committer | Marton Balint <cus@passwd.hu> | 2018-04-30 21:51:31 +0200 |
commit | 7033654f7f3c6663c9b5005b87fc06c29075244d (patch) | |
tree | 3b27c9b0c654a5f78a0e0cc23b3a46108405a242 /libavcodec/ffv1enc.c | |
parent | 56b081da578f87aed804b44e539f6e5345f3049a (diff) | |
download | ffmpeg-7033654f7f3c6663c9b5005b87fc06c29075244d.tar.gz |
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 <cus@passwd.hu>
Diffstat (limited to 'libavcodec/ffv1enc.c')
-rw-r--r-- | libavcodec/ffv1enc.c | 4 |
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) { |