[FFmpeg-cvslog] avprobe: use avio_size() instead of deprecated AVFormatContext.file_size.

Anton Khirnov git at videolan.org
Fri Jan 13 01:41:24 CET 2012


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Thu Jan 12 09:45:13 2012 +0100| [136ee32da3c728fb4e3490393efb947cc7c4e898] | committer: Anton Khirnov

avprobe: use avio_size() instead of deprecated AVFormatContext.file_size.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=136ee32da3c728fb4e3490393efb947cc7c4e898
---

 avprobe.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/avprobe.c b/avprobe.c
index de9657b..4d2ed67 100644
--- a/avprobe.c
+++ b/avprobe.c
@@ -243,6 +243,7 @@ static void show_format(AVFormatContext *fmt_ctx)
 {
     AVDictionaryEntry *tag = NULL;
     char val_str[128];
+    int64_t size = fmt_ctx->pb ? avio_size(fmt_ctx->pb) : -1;
 
     printf("[FORMAT]\n");
 
@@ -254,8 +255,9 @@ static void show_format(AVFormatContext *fmt_ctx)
                                                       &AV_TIME_BASE_Q));
     printf("duration=%s\n",         time_value_string(val_str, sizeof(val_str), fmt_ctx->duration,
                                                       &AV_TIME_BASE_Q));
-    printf("size=%s\n",             value_string(val_str, sizeof(val_str), fmt_ctx->file_size,
-                                                 unit_byte_str));
+    printf("size=%s\n",             size >= 0 ? value_string(val_str, sizeof(val_str),
+                                                             size, unit_byte_str)
+                                              : "unknown");
     printf("bit_rate=%s\n",         value_string(val_str, sizeof(val_str), fmt_ctx->bit_rate,
                                                  unit_bit_per_second_str));
 



More information about the ffmpeg-cvslog mailing list