aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClément Bœsch <ubitux@gmail.com>2011-11-05 13:16:32 +0100
committerClément Bœsch <ubitux@gmail.com>2011-11-05 15:07:19 +0100
commit434db5719e5d52ab9e350a51bb4f41b0c94b72d3 (patch)
treeb93e4a1c9f9a7c5caf23a5f64cb1809248f7ee38
parent1e4027747a70fbf8ab60e0ffc113bcdc0c20acb1 (diff)
downloadffmpeg-434db5719e5d52ab9e350a51bb4f41b0c94b72d3.tar.gz
ffprobe: use avio_size() instead of deprecated file_size attribute.
-rw-r--r--ffprobe.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ffprobe.c b/ffprobe.c
index 4ee87ecb5e..baffe0b375 100644
--- a/ffprobe.c
+++ b/ffprobe.c
@@ -748,6 +748,7 @@ static void show_streams(WriterContext *w, AVFormatContext *fmt_ctx)
static void show_format(WriterContext *w, AVFormatContext *fmt_ctx)
{
char val_str[128];
+ int64_t size = avio_size(fmt_ctx->pb);
struct print_buf pbuf = {.s = NULL};
print_section_header("format");
@@ -757,7 +758,8 @@ static void show_format(WriterContext *w, AVFormatContext *fmt_ctx)
print_str("format_long_name", fmt_ctx->iformat->long_name);
print_str("start_time", time_value_string(val_str, sizeof(val_str), fmt_ctx->start_time, &AV_TIME_BASE_Q));
print_str("duration", time_value_string(val_str, sizeof(val_str), fmt_ctx->duration, &AV_TIME_BASE_Q));
- print_str("size", value_string(val_str, sizeof(val_str), fmt_ctx->file_size, unit_byte_str));
+ if (size >= 0)
+ print_str("size", value_string(val_str, sizeof(val_str), size, unit_byte_str));
print_str("bit_rate", value_string(val_str, sizeof(val_str), fmt_ctx->bit_rate, unit_bit_per_second_str));
show_tags(fmt_ctx->metadata);
print_section_footer("format");