[FFmpeg-cvslog] r22983 - trunk/ffprobe.c

stefano subversion
Wed Apr 28 01:22:27 CEST 2010


Author: stefano
Date: Wed Apr 28 01:22:27 2010
New Revision: 22983

Log:
Make ffprobe show sample_aspect_ratio and display_aspect_ratio only if
sample_aspect_ratio is known.

Avoid to show bogus values, which may confuse both the human and the
machine reader.

Based on a patch by Robert Kr?ger $(echo lsvfhfs at tjhobm7.ef | tr "b-za" "a-z").

Modified:
   trunk/ffprobe.c

Modified: trunk/ffprobe.c
==============================================================================
--- trunk/ffprobe.c	Wed Apr 28 00:45:27 2010	(r22982)
+++ trunk/ffprobe.c	Wed Apr 28 01:22:27 2010	(r22983)
@@ -155,6 +155,7 @@ static void show_stream(AVFormatContext 
             printf("width=%d\n",                   dec_ctx->width);
             printf("height=%d\n",                  dec_ctx->height);
             printf("has_b_frames=%d\n",            dec_ctx->has_b_frames);
+            if (dec_ctx->sample_aspect_ratio.num) {
             printf("sample_aspect_ratio=%d:%d\n",  dec_ctx->sample_aspect_ratio.num,
                                                    dec_ctx->sample_aspect_ratio.den);
             av_reduce(&display_aspect_ratio.num, &display_aspect_ratio.den,
@@ -163,6 +164,7 @@ static void show_stream(AVFormatContext 
                       1024*1024);
             printf("display_aspect_ratio=%d:%d\n", display_aspect_ratio.num,
                                                    display_aspect_ratio.den);
+            }
             printf("pix_fmt=%s\n",                 dec_ctx->pix_fmt != PIX_FMT_NONE ?
                    av_pix_fmt_descriptors[dec_ctx->pix_fmt].name : "unknown");
             break;



More information about the ffmpeg-cvslog mailing list