[PATCH 2/3] Make avcodec_pix_fmt_string() use the information in the pixel format descriptors for printing the number of components.

Stefano Sabatini stefano.sabatini-lala
Fri Nov 5 11:49:38 CET 2010


Also replace the term "nb_channels" with "nb_components" which is more
consistent with the FFmpeg internal terminology.
---
 libavcodec/imgconvert.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/libavcodec/imgconvert.c b/libavcodec/imgconvert.c
index 3d7e759..74bef43 100644
--- a/libavcodec/imgconvert.c
+++ b/libavcodec/imgconvert.c
@@ -437,15 +437,14 @@ void avcodec_pix_fmt_string (char *buf, int buf_size, enum PixelFormat pix_fmt)
     /* print header */
     if (pix_fmt < 0)
         snprintf (buf, buf_size,
-                  "name      " " nb_channels" " depth"
+                  "name      " " nb_components" " depth"
             );
     else{
-        PixFmtInfo info= pix_fmt_info[pix_fmt];
-
+        const AVPixFmtDescriptor *pixdesc = &av_pix_fmt_descriptors[pix_fmt];
         snprintf (buf, buf_size,
-                  "%-11s %5d %9d",
+                  "%-11s %7d %9d",
                   av_pix_fmt_descriptors[pix_fmt].name,
-                  info.nb_channels,
+                  pixdesc->nb_components,
                   av_get_bits_per_pixel(&av_pix_fmt_descriptors[pix_fmt])
             );
     }
-- 
1.7.1


--huq684BweRXVnRxX--



More information about the ffmpeg-devel mailing list