swscale: check flags instead of nb_components to find if pixel format have alpha
authorPaul B Mahol <onemda@gmail.com>
Thu, 24 Jan 2013 17:32:37 +0000 (17:32 +0000)
committerPaul B Mahol <onemda@gmail.com>
Fri, 25 Jan 2013 13:06:00 +0000 (13:06 +0000)
Signed-off-by: Paul B Mahol <onemda@gmail.com>
libswscale/swscale_internal.h

index d1f9539..4f4b953 100644 (file)
@@ -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;
 }
 
 #if 1