[FFmpeg-cvslog] ffmpeg: do not use a negative total_size (AVERROR) in bitrate estimation.

Clément Bœsch git at videolan.org
Tue Nov 29 23:15:48 CET 2011


ffmpeg | branch: master | Clément Bœsch <clement.boesch at smartjog.com> | Tue Nov 29 17:59:40 2011 +0100| [b6ffe441cdc1f5591105db18408c30478f93036e] | committer: Clément Bœsch

ffmpeg: do not use a negative total_size (AVERROR) in bitrate estimation.

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

 ffmpeg.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/ffmpeg.c b/ffmpeg.c
index 40f5ea8..5e8423d 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1434,8 +1434,11 @@ static void print_report(OutputFile *output_files,
     oc = output_files[0].ctx;
 
     total_size = avio_size(oc->pb);
-    if(total_size<0) // FIXME improve avio_size() so it works with non seekable output too
+    if (total_size < 0) { // FIXME improve avio_size() so it works with non seekable output too
         total_size= avio_tell(oc->pb);
+        if (total_size < 0)
+            total_size = 0;
+    }
 
     buf[0] = '\0';
     vid = 0;



More information about the ffmpeg-cvslog mailing list