[FFmpeg-devel] [PATCH] swscale: check flags instead of nb_components to find if pixel format have alpha

Stefano Sabatini stefasab at gmail.com
Fri Jan 25 00:11:09 CET 2013


On date Thursday 2013-01-24 17:34:06 +0000, Paul B Mahol encoded:
> Signed-off-by: Paul B Mahol <onemda at gmail.com>
> ---
>  libswscale/swscale_internal.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h
> index d1f9539..4f4b953 100644
> --- a/libswscale/swscale_internal.h
> +++ b/libswscale/swscale_internal.h
> @@ -688,7 +688,7 @@ static av_always_inline int isALPHA(enum AVPixelFormat pix_fmt)
>  {
>      const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
>      av_assert0(desc);
> -    return desc->nb_components == 2 || desc->nb_components == 4;
> +    return desc->flags & PIX_FMT_ALPHA;

Should be OK if FATE is happy.
-- 
FFmpeg = Fierce and Friendly Merciful Prodigious Educated Gladiator


More information about the ffmpeg-devel mailing list