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

Paul B Mahol git at videolan.org
Fri Jan 25 14:08:54 CET 2013


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Thu Jan 24 17:32:37 2013 +0000| [d07b0d992736e01006caa64b87d996f902d357db] | committer: Paul B Mahol

swscale: check flags instead of nb_components to find if pixel format have alpha

Signed-off-by: Paul B Mahol <onemda at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d07b0d992736e01006caa64b87d996f902d357db
---

 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



More information about the ffmpeg-cvslog mailing list