[FFmpeg-cvslog] avutil/pixdesc: simplify xyz pixfmt check

Niklas Haas git at videolan.org
Tue Oct 31 16:50:24 EET 2023


ffmpeg | branch: master | Niklas Haas <git at haasn.dev> | Thu Oct 26 13:55:09 2023 +0200| [93f07d98d98481c08215ce005b3b5428ee5b6525] | committer: Niklas Haas

avutil/pixdesc: simplify xyz pixfmt check

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

 libavutil/pixdesc.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
index f2647d3d55..4e4a63e287 100644
--- a/libavutil/pixdesc.c
+++ b/libavutil/pixdesc.c
@@ -3055,13 +3055,13 @@ static int get_color_type(const AVPixFmtDescriptor *desc) {
     if (desc->name) {
         if (av_strstart(desc->name, "yuvj", NULL))
             return FF_COLOR_YUV_JPEG;
-
-        if (av_strstart(desc->name, "xyz", NULL))
-            return FF_COLOR_XYZ;
     }
 
     if(desc->flags & AV_PIX_FMT_FLAG_RGB)
-        return  FF_COLOR_RGB;
+        return FF_COLOR_RGB;
+
+    if(desc->flags & AV_PIX_FMT_FLAG_XYZ)
+        return FF_COLOR_XYZ;
 
     if(desc->nb_components == 0)
         return FF_COLOR_NA;



More information about the ffmpeg-cvslog mailing list