ffprobe: report unavailable SAR correctly in stream info

av_guess_sample_aspect_ratio() will return undefined or missing
value as {0,1}. This fixes show_stream() to check numerator to
display 'N/A' when appropriate. show_frame() does this already
correctly.

Signed-off-by: Timo Teräs <timo.teras@iki.fi>
pull/298/head
Timo Teräs 7 years ago committed by Rostislav Pehlivanov
parent 2fc12f4971
commit c663dce031
  1. 2
      fftools/ffprobe.c

@ -2521,7 +2521,7 @@ static int show_stream(WriterContext *w, AVFormatContext *fmt_ctx, int stream_id
#endif #endif
print_int("has_b_frames", par->video_delay); print_int("has_b_frames", par->video_delay);
sar = av_guess_sample_aspect_ratio(fmt_ctx, stream, NULL); sar = av_guess_sample_aspect_ratio(fmt_ctx, stream, NULL);
if (sar.den) { if (sar.num) {
print_q("sample_aspect_ratio", sar, ':'); print_q("sample_aspect_ratio", sar, ':');
av_reduce(&dar.num, &dar.den, av_reduce(&dar.num, &dar.den,
par->width * sar.num, par->width * sar.num,

Loading…
Cancel
Save