summaryrefslogtreecommitdiff
path: root/avconv.c
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2014-02-19 21:41:12 +0100
committerLuca Barbato <lu_zero@gentoo.org>2014-02-20 18:58:38 +0100
commit5c79d2e12d13959fc6aed92d102c25194a06de05 (patch)
treedeaaf78c0d1f71792a8ee77f3087554427880f79 /avconv.c
parentd6a27f885b5d4cba7a82e50af423c741d2f37c3e (diff)
avconv: Do not divide by zero
Diffstat (limited to 'avconv.c')
-rw-r--r--avconv.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/avconv.c b/avconv.c
index edce1e5fb2..64e832149c 100644
--- a/avconv.c
+++ b/avconv.c
@@ -858,14 +858,18 @@ static void print_report(int is_last_report, int64_t timer_start)
fflush(stderr);
if (is_last_report) {
- int64_t raw= audio_size + video_size + extra_size;
+ int64_t raw = audio_size + video_size + extra_size;
+ float percent = 0.0;
+
+ if (raw)
+ percent = 100.0 * (total_size - raw) / raw;
+
av_log(NULL, AV_LOG_INFO, "\n");
av_log(NULL, AV_LOG_INFO, "video:%1.0fkB audio:%1.0fkB global headers:%1.0fkB muxing overhead %f%%\n",
video_size / 1024.0,
audio_size / 1024.0,
extra_size / 1024.0,
- 100.0 * (total_size - raw) / raw
- );
+ percent);
}
}