summaryrefslogtreecommitdiff
path: root/fftools/ffprobe.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2021-02-08 12:03:00 +0100
committerAnton Khirnov <anton@khirnov.net>2021-02-22 11:13:50 +0100
commitcb789fd2b34864df30bc4b664cfee632dca0a1e4 (patch)
tree9fb21b4e0682cc49fb93872a81d87fc79dcde4e5 /fftools/ffprobe.c
parent65b08aa19c26dd3d310e1610bd9a2ace8756ce95 (diff)
ffprobe: do not use deprecated AVStream.codec for max bitrate
Use the decoder context instead.
Diffstat (limited to 'fftools/ffprobe.c')
-rw-r--r--fftools/ffprobe.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
index 4e5beb5710..f7d042525e 100644
--- a/fftools/ffprobe.c
+++ b/fftools/ffprobe.c
@@ -2754,10 +2754,10 @@ static int show_stream(WriterContext *w, AVFormatContext *fmt_ctx, int stream_id
print_time("duration", stream->duration, &stream->time_base);
if (par->bit_rate > 0) print_val ("bit_rate", par->bit_rate, unit_bit_per_second_str);
else print_str_opt("bit_rate", "N/A");
-#if FF_API_LAVF_AVCTX
- if (stream->codec->rc_max_rate > 0) print_val ("max_bit_rate", stream->codec->rc_max_rate, unit_bit_per_second_str);
- else print_str_opt("max_bit_rate", "N/A");
-#endif
+ if (dec_ctx && dec_ctx->rc_max_rate > 0)
+ print_val ("max_bit_rate", dec_ctx->rc_max_rate, unit_bit_per_second_str);
+ else
+ print_str_opt("max_bit_rate", "N/A");
if (dec_ctx && dec_ctx->bits_per_raw_sample > 0) print_fmt("bits_per_raw_sample", "%d", dec_ctx->bits_per_raw_sample);
else print_str_opt("bits_per_raw_sample", "N/A");
if (stream->nb_frames) print_fmt ("nb_frames", "%"PRId64, stream->nb_frames);