summaryrefslogtreecommitdiff
path: root/ffprobe.c
diff options
context:
space:
mode:
authorRobert Krüger <krueger@signal7.de>2010-04-13 23:41:46 +0000
committerStefano Sabatini <stefano.sabatini-lala@poste.it>2010-04-13 23:41:46 +0000
commitd21b227818a985ffbda756127af4fcbb0d1a7362 (patch)
tree1c3b173e240d6238eccdcd93add3d42f62f20664 /ffprobe.c
parent4563cf247dfbe45ffe49f11dd97556ed4a8b2c1e (diff)
Fix computation of the display aspect ratio.
Previously ffprobe was wrongly outputting the sample aspect ratio as display aspect ratio. Patch by Robert Krüger $(echo k-r-u-e-g-e-r@s-i-g-n-a-l-7.d-e | sed s/-//g). Originally committed as revision 22880 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'ffprobe.c')
-rw-r--r--ffprobe.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/ffprobe.c b/ffprobe.c
index f0669a475d..f9f5715ea5 100644
--- a/ffprobe.c
+++ b/ffprobe.c
@@ -121,6 +121,7 @@ static void show_stream(AVFormatContext *fmt_ctx, int stream_idx)
char val_str[128];
AVMetadataTag *tag = NULL;
char a, b, c, d;
+ AVRational display_aspect_ratio;
printf("[STREAM]\n");
@@ -156,8 +157,12 @@ static void show_stream(AVFormatContext *fmt_ctx, int stream_idx)
printf("has_b_frames=%d\n", dec_ctx->has_b_frames);
printf("sample_aspect_ratio=%d:%d\n", dec_ctx->sample_aspect_ratio.num,
dec_ctx->sample_aspect_ratio.den);
- printf("display_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,
+ dec_ctx->width*dec_ctx->sample_aspect_ratio.num,
+ dec_ctx->height*dec_ctx->sample_aspect_ratio.den,
+ 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;