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

Paul B Mahol onemda at gmail.com
Thu Jan 24 18:34:06 CET 2013


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;
 }
 
 #if 1
-- 
1.7.11.4



More information about the ffmpeg-devel mailing list