[FFmpeg-cvslog] avcodec/utils: Display pixel format information as none ... if unknown instead of omitting it

Michael Niedermayer git at videolan.org
Sun Oct 19 04:28:22 CEST 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri Oct 10 03:16:50 2014 +0200| [e23af4662dc667cdb6b7cd297f8cc0160a63e9bf] | committer: Michael Niedermayer

avcodec/utils: Display pixel format information as none ... if unknown instead of omitting it

This is similar to 20a5956b8daeee4cb59d6fa00ec809b02c04d7f8

The difference this change makes affects only rather few files
but looks like:
Stream #0:1: Video: mjpeg, 90k tbr, 90k tbn, 90k tbc
vs.
Stream #0:1: Video: mjpeg, none(bt470bg/unknown/unknown), 90k tbr, 90k tbn, 90k tbc

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavcodec/utils.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index f040dae..93be575 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -3005,7 +3005,7 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
 
     switch (enc->codec_type) {
     case AVMEDIA_TYPE_VIDEO:
-        if (enc->pix_fmt != AV_PIX_FMT_NONE) {
+        {
             char detail[256] = "(";
 
             av_strlcat(buf, separator, buf_size);
@@ -3013,7 +3013,7 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
             snprintf(buf + strlen(buf), buf_size - strlen(buf),
                  "%s", enc->pix_fmt == AV_PIX_FMT_NONE ? "none" :
                      av_get_pix_fmt_name(enc->pix_fmt));
-            if (enc->bits_per_raw_sample &&
+            if (enc->bits_per_raw_sample && enc->pix_fmt != AV_PIX_FMT_NONE &&
                 enc->bits_per_raw_sample <= av_pix_fmt_desc_get(enc->pix_fmt)->comp[0].depth_minus1)
                 av_strlcatf(detail, sizeof(detail), "%d bpc, ", enc->bits_per_raw_sample);
             if (enc->color_range != AVCOL_RANGE_UNSPECIFIED)



More information about the ffmpeg-cvslog mailing list