Commit 95d6d021 authored by stefano's avatar stefano

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).

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@22880 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 93c99443
...@@ -121,6 +121,7 @@ static void show_stream(AVFormatContext *fmt_ctx, int stream_idx) ...@@ -121,6 +121,7 @@ static void show_stream(AVFormatContext *fmt_ctx, int stream_idx)
char val_str[128]; char val_str[128];
AVMetadataTag *tag = NULL; AVMetadataTag *tag = NULL;
char a, b, c, d; char a, b, c, d;
AVRational display_aspect_ratio;
printf("[STREAM]\n"); printf("[STREAM]\n");
...@@ -156,8 +157,12 @@ static void show_stream(AVFormatContext *fmt_ctx, int stream_idx) ...@@ -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("has_b_frames=%d\n", dec_ctx->has_b_frames);
printf("sample_aspect_ratio=%d:%d\n", 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); dec_ctx->sample_aspect_ratio.den);
printf("display_aspect_ratio=%d:%d\n", dec_ctx->sample_aspect_ratio.num, av_reduce(&display_aspect_ratio.num, &display_aspect_ratio.den,
dec_ctx->sample_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 ? printf("pix_fmt=%s\n", dec_ctx->pix_fmt != PIX_FMT_NONE ?
av_pix_fmt_descriptors[dec_ctx->pix_fmt].name : "unknown"); av_pix_fmt_descriptors[dec_ctx->pix_fmt].name : "unknown");
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment